Restore the descriptions to conform with the rest of the
[openssl.git] / doc / crypto / dh.pod
1 =pod
2
3 =head1 NAME
4
5 dh - Diffie-Hellman key agreement
6
7 =head1 SYNOPSIS
8
9  #include <openssl/dh.h>
10
11  DH *   DH_new(void);
12  void   DH_free(DH *dh);
13
14  int    DH_size(DH *dh);
15
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);
19
20  int    DH_generate_key(DH *dh);
21  int    DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh);
22
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);
28
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);
33
34  DH *   d2i_DHparams(DH **a, unsigned char **pp, long length);
35  int    i2d_DHparams(DH *a, unsigned char **pp);
36
37  int    DHparams_print_fp(FILE *fp, DH *x);
38  int    DHparams_print(BIO *bp, DH *x);
39
40 =head1 DESCRIPTION
41
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.
46
47 The B<DH> structure consists of several BIGNUM components.
48
49  struct
50         {
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
55         // ...
56         };
57  DH
58
59 =head1 SEE ALSO
60
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)> 
67
68 =cut