dh.3 revision 279265
Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)

Standard preamble:
========================================================================
..
..
.. Set up some character translations and predefined strings. \*(-- will
give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
double quote, and \*(R" will give a right double quote. \*(C+ will
give a nicer C++. Capital omega is used to do unbreakable dashes and
therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
nothing in troff, for use with C<>.
.tr \(*W- . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\}
Escape single quotes in literal strings from groff's Unicode transform.

If the F register is turned on, we'll generate index entries on stderr for
titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
entries marked with X<> in POD. Of course, you'll have to process the
output yourself in some meaningful fashion.

Avoid warning from groff about undefined register 'F'.
.. .nr rF 0 . if \nF \{ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{ . nr % 0 . nr F 2 . \} . \} .\} .rr rF
Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] .\} . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents . \" corrections for vroff . \" for low resolution devices (crt and lpr) \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} ========================================================================

Title "dh 3"
dh 3 "2015-01-08" "0.9.8zd" "OpenSSL"
For nroff, turn off justification. Always turn off hyphenation; it makes
way too many mistakes in technical documents.
"NAME"
dh - Diffie-Hellman key agreement
"SYNOPSIS"
Header "SYNOPSIS" .Vb 2 #include <openssl/dh.h> #include <openssl/engine.h> \& DH * DH_new(void); void DH_free(DH *dh); \& int DH_size(const DH *dh); \& DH * DH_generate_parameters(int prime_len, int generator, void (*callback)(int, int, void *), void *cb_arg); int DH_check(const DH *dh, int *codes); \& int DH_generate_key(DH *dh); int DH_compute_key(unsigned char *key, BIGNUM *pub_key, DH *dh); \& void DH_set_default_method(const DH_METHOD *meth); const DH_METHOD *DH_get_default_method(void); int DH_set_method(DH *dh, const DH_METHOD *meth); DH *DH_new_method(ENGINE *engine); const DH_METHOD *DH_OpenSSL(void); \& int DH_get_ex_new_index(long argl, char *argp, int (*new_func)(), int (*dup_func)(), void (*free_func)()); int DH_set_ex_data(DH *d, int idx, char *arg); char *DH_get_ex_data(DH *d, int idx); \& DH * d2i_DHparams(DH **a, unsigned char **pp, long length); int i2d_DHparams(const DH *a, unsigned char **pp); \& int DHparams_print_fp(FILE *fp, const DH *x); int DHparams_print(BIO *bp, const DH *x); .Ve
"DESCRIPTION"
Header "DESCRIPTION" These functions implement the Diffie-Hellman key agreement protocol. The generation of shared \s-1DH\s0 parameters is described in \fIDH_generate_parameters\|(3); DH_generate_key\|(3) describes how to perform a key agreement.

The \s-1DH\s0 structure consists of several \s-1BIGNUM\s0 components.

.Vb 9 struct { BIGNUM *p; // prime number (shared) BIGNUM *g; // generator of Z_p (shared) BIGNUM *priv_key; // private DH value x BIGNUM *pub_key; // public DH value g^x // ... }; DH .Ve

Note that \s-1DH\s0 keys may use non-standard \s-1DH_METHOD\s0 implementations, either directly or by the use of \s-1ENGINE\s0 modules. In some cases (eg. an \s-1ENGINE\s0 providing support for hardware-embedded keys), these \s-1BIGNUM\s0 values will not be used by the implementation or may be used for alternative data storage. For this reason, applications should generally avoid using \s-1DH\s0 structure elements directly and instead use \s-1API\s0 functions to query or modify keys.

"SEE ALSO"
Header "SEE ALSO" \fIdhparam\|(1), bn\|(3), dsa\|(3), err\|(3), \fIrand\|(3), rsa\|(3), engine\|(3), \fIDH_set_method\|(3), DH_new\|(3), \fIDH_get_ex_new_index\|(3), \fIDH_generate_parameters\|(3), \fIDH_compute_key\|(3), d2i_DHparams\|(3), \fIRSA_print\|(3)