5 dh - Diffie-Hellman key agreement
9 #include <openssl/dh.h>
16 DH * DH_generate_parameters(int prime_len, int generator,
17 void (*callback)(int, int, void *), void *cb_arg);
18 int DH_check(DH *dh, int *codes);
20 int DH_generate_key(DH *dh);
21 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
23 void DH_set_default_method(DH_METHOD *meth);
24 DH_METHOD *DH_get_default_method(void);
25 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth);
26 DH *DH_new_method(DH_METHOD *meth);
27 DH_METHOD *DH_OpenSSL(void);
29 int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(),
30 int (*dup_func)(), void (*free_func)());
31 int DH_set_ex_data(DH *d, int idx, char *arg);
32 char *DH_get_ex_data(DH *d, int idx);
34 DH * d2i_DHparams(DH **a, unsigned char **pp, long length);
35 int i2d_DHparams(DH *a, unsigned char **pp);
37 int DHparams_print_fp(FILE *fp, DH *x);
38 int DHparams_print(BIO *bp, DH *x);
42 These functions implement the Diffie-Hellman key agreement protocol.
43 The generation of shared DH parameters is described in
44 L<DH_generate_parameters(3)|DH_generate_parameters(3)>; L<DH_generate_key(3)|DH_generate_key(3)> describes how
45 to perform a key agreement.
47 The B<DH> structure consists of several BIGNUM components.
51 BIGNUM *p; // prime number (shared)
52 BIGNUM *g; // generator of Z_p (shared)
53 BIGNUM *priv_key; // private DH value x
54 BIGNUM *pub_key; // public DH value g^x
61 L<dhparam(1)|dhparam(1)>, L<bn(3)|bn(3)>, L<dsa(3)|dsa(3)>, L<err(3)|err(3)>,
62 L<rand(3)|rand(3)>, L<rsa(3)|rsa(3)>, L<DH_set_method(3)|DH_set_method(3)>,
63 L<DH_new(3)|DH_new(3)>, L<DH_get_ex_new_index(3)|DH_get_ex_new_index(3)>,
64 L<DH_generate_parameters(3)|DH_generate_parameters(3)>,
65 L<DH_compute_key(3)|DH_compute_key(3)>, L<d2i_DHparams(3)|d2i_DHparams(3)>,
66 L<RSA_print(3)|RSA_print(3)>