5 dh - Diffie-Hellman key agreement
9 #include <openssl/dh.h>
11 void DH_set_default_method(DH_METHOD *meth);
12 DH_METHOD *DH_get_default_method(void);
13 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth);
14 DH *DH_new_method(DH_METHOD *meth);
15 DH_METHOD *DH_OpenSSL(void);
22 int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(),
23 int (*dup_func)(), void (*free_func)());
24 int DH_set_ex_data(DH *d, int idx, char *arg);
25 char *DH_get_ex_data(DH *d, int idx);
27 DH * DH_generate_parameters(int prime_len, int generator,
28 void (*callback)(int, int, void *), void *cb_arg);
29 int DH_check(DH *dh, int *codes);
31 int DH_generate_key(DH *dh);
32 int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
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)>; L<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 dhparam(1), bn(3), dsa(3), err(3), rand(3), rsa(3), DH_set_method(3),
62 DH_new(3), DH_get_ex_new_index(3), DH_generate_parameters(3),
63 DH_compute_key(3), d2i_DHparams(3), RSA_print(3)