DH_set_method.3 revision 100947
Automatically generated by Pod::Man version 1.15
Tue Jul 30 09:21:27 2002

Standard preamble:
======================================================================

\\$1

.. ..

"\\$1" \\$2
..
..

.. 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. | will give a
real vertical bar. \*(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-|\(bv\*(Tr . 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" '' 'br\}
If the F register is turned on, we'll generate index entries on stderr
for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
index entries marked with X<> in POD. Of course, you'll have to process
the output yourself in some meaningful fashion.
. de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\}
For nroff, turn off justification. Always turn off hyphenation; it
makes way too many mistakes in technical documents.

Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
Fear. Run. Save yourself. No user-serviceable parts.
.bd B 3 . \" 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_set_method 3"
DH_set_method 3 "0.9.6e" "2000-11-12" "OpenSSL"
C
"NAME"
DH_set_default_method, DH_get_default_method, DH_set_method, DH_new_method, DH_OpenSSL - select \s-1DH\s0 method
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/dh.h> .Ve .Vb 1 void DH_set_default_method(DH_METHOD *meth); .Ve .Vb 1 DH_METHOD *DH_get_default_method(void); .Ve .Vb 1 DH_METHOD *DH_set_method(DH *dh, DH_METHOD *meth); .Ve .Vb 1 DH *DH_new_method(DH_METHOD *meth); .Ve .Vb 1 DH_METHOD *DH_OpenSSL(void); .Ve
"DESCRIPTION"
Header "DESCRIPTION" A \s-1DH_METHOD\s0 specifies the functions that OpenSSL uses for Diffie-Hellman operations. By modifying the method, alternative implementations such as hardware accelerators may be used.

Initially, the default is to use the OpenSSL internal implementation. \fIDH_OpenSSL() returns a pointer to that method.

\fIDH_set_default_method() makes meth the default method for all \s-1DH\s0 structures created later.

\fIDH_get_default_method() returns a pointer to the current default method.

\fIDH_set_method() selects meth for all operations using the structure dh.

\fIDH_new_method() allocates and initializes a \s-1DH\s0 structure so that \fBmethod will be used for the \s-1DH\s0 operations. If method is \s-1NULL\s0, the default method is used.

"THE DH_METHOD STRUCTURE"
Header "THE DH_METHOD STRUCTURE" .Vb 4 typedef struct dh_meth_st { /* name of the implementation */ const char *name; .Ve .Vb 2 /* generate private and public DH values for key agreement */ int (*generate_key)(DH *dh); .Ve .Vb 2 /* compute shared secret */ int (*compute_key)(unsigned char *key, BIGNUM *pub_key, DH *dh); .Ve .Vb 4 /* compute r = a ^ p mod m (May be NULL for some implementations) */ int (*bn_mod_exp)(DH *dh, BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); .Ve .Vb 2 /* called at DH_new */ int (*init)(DH *dh); .Ve .Vb 2 /* called at DH_free */ int (*finish)(DH *dh); .Ve .Vb 1 int flags; .Ve .Vb 1 char *app_data; /* ?? */ .Ve .Vb 1 } DH_METHOD; .Ve
"RETURN VALUES"
Header "RETURN VALUES" \fIDH_OpenSSL() and DH_get_default_method() return pointers to the respective \fB\s-1DH_METHOD\s0s.

\fIDH_set_default_method() returns no value.

\fIDH_set_method() returns a pointer to the \s-1DH_METHOD\s0 previously associated with dh.

\fIDH_new_method() returns \s-1NULL\s0 and sets an error code that can be obtained by ERR_get_error(3) if the allocation fails. Otherwise it returns a pointer to the newly allocated structure.

"SEE ALSO"
Header "SEE ALSO" dh(3), DH_new(3)
"HISTORY"
Header "HISTORY" \fIDH_set_default_method(), DH_get_default_method(), DH_set_method(), \fIDH_new_method() and DH_OpenSSL() were added in OpenSSL 0.9.4.