DSA_set_method.3 revision 96593
Automatically generated by Pod::Man version 1.15
Thu May 9 13:17:21 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 "DSA_SET_METHOD 1"
DSA_SET_METHOD 1 "perl v5.6.1" "2000-11-13" "User Contributed Perl Documentation"
C
"NAME"
DSA_set_default_method, DSA_get_default_method, DSA_set_method, DSA_new_method, DSA_OpenSSL - select \s-1DSA\s0 method
"SYNOPSIS"
Header "SYNOPSIS" .Vb 1 #include <openssl/dsa.h> .Ve .Vb 1 void DSA_set_default_method(DSA_METHOD *meth); .Ve .Vb 1 DSA_METHOD *DSA_get_default_method(void); .Ve .Vb 1 DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth); .Ve .Vb 1 DSA *DSA_new_method(DSA_METHOD *meth); .Ve .Vb 1 DSA_METHOD *DSA_OpenSSL(void); .Ve
"DESCRIPTION"
Header "DESCRIPTION" A \s-1DSA_METHOD\s0 specifies the functions that OpenSSL uses for \s-1DSA\s0 operations. By modifying the method, alternative implementations such as hardware accelerators may be used.

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

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

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

\fIDSA_set_method() selects meth for all operations using the structure dsa.

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

"THE DSA_METHOD STRUCTURE"
Header "THE DSA_METHOD STRUCTURE" struct { /* name of the implementation */ const char *name;

.Vb 3 /* sign */ DSA_SIG *(*dsa_do_sign)(const unsigned char *dgst, int dlen, DSA *dsa); .Ve .Vb 3 /* pre-compute k^-1 and r */ int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp); .Ve .Vb 3 /* verify */ int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, DSA_SIG *sig, DSA *dsa); .Ve .Vb 5 /* compute rr = a1^p1 * a2^p2 mod m (May be NULL for some implementations) */ int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); .Ve .Vb 4 /* compute r = a ^ p mod m (May be NULL for some implementations) */ int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); .Ve .Vb 2 /* called at DSA_new */ int (*init)(DSA *DSA); .Ve .Vb 2 /* called at DSA_free */ int (*finish)(DSA *DSA); .Ve .Vb 1 int flags; .Ve .Vb 1 char *app_data; /* ?? */ .Ve .Vb 1 } DSA_METHOD; .Ve

"RETURN VALUES"
Header "RETURN VALUES" \fIDSA_OpenSSL() and DSA_get_default_method() return pointers to the respective \s-1DSA_METHOD\s0s.

\fIDSA_set_default_method() returns no value.

\fIDSA_set_method() returns a pointer to the \s-1DSA_METHOD\s0 previously associated with dsa.

\fIDSA_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" dsa(3), DSA_new(3)
"HISTORY"
Header "HISTORY" \fIDSA_set_default_method(), DSA_get_default_method(), DSA_set_method(), \fIDSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4.