5 dh - Diffie-Hellman key agreement
9 #include <openssl/dh.h>
10 #include <openssl/engine.h>
15 DH * DH_generate_parameters(int prime_len, int generator,
16 void (*callback)(int, int, void *), void *cb_arg);
17 int DH_check(const DH *dh, int *codes);
19 int DH_generate_key(DH *dh);
20 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
22 void DH_set_default_method(const DH_METHOD *meth);
23 const DH_METHOD *DH_get_default_method(void);
24 int DH_set_method(DH *dh, const DH_METHOD *meth);
25 DH *DH_new_method(ENGINE *engine);
26 const DH_METHOD *DH_OpenSSL(void);
28 DH * d2i_DHparams(DH **a, unsigned char **pp, long length);
29 int i2d_DHparams(const DH *a, unsigned char **pp);
31 int DHparams_print_fp(FILE *fp, const DH *x);
32 int DHparams_print(BIO *bp, const DH *x);
36 These functions implement the Diffie-Hellman key agreement protocol.
37 The generation of shared DH parameters is described in
38 L<DH_generate_parameters(3)>; L<DH_generate_key(3)> describes how
39 to perform a key agreement.
41 The B<DH> structure consists of several BIGNUM components. The prime B<p>, the
42 generate B<g>, the Private key B<priv_key> and the public key B<pub_key>.
43 Optionally there may also be an additional parameter B<q>.
45 Note that DH keys may use non-standard B<DH_METHOD> implementations,
46 either directly or by the use of B<ENGINE> modules. In some cases (eg. an
47 ENGINE providing support for hardware-embedded keys), these BIGNUM values
48 will not be used by the implementation or may be used for alternative data
53 L<dhparam(1)>, L<bn(3)>, L<dsa(3)>, L<err(3)>,
54 L<rand(3)>, L<rsa(3)>, L<engine(3)>,
55 L<DH_set_method(3)>, L<DH_new(3)>,
56 L<DH_get_ex_new_index(3)>,
57 L<DH_generate_parameters(3)>,
58 L<DH_compute_key(3)>, L<DH_get0_pqg(3)>, L<DH_meth_new(3)>, L<d2i_DHparams(3)>,