Remove structures that are no longer used.
[openssl.git] / doc / crypto / DSA_set_method.pod
1 =pod
2
3 =head1 NAME
4
5 DSA_set_default_method, DSA_get_default_method, DSA_set_method,
6 DSA_new_method, DSA_OpenSSL - select RSA method
7
8 =head1 SYNOPSIS
9
10  #include <openssl/DSA.h>
11
12  void DSA_set_default_method(DSA_METHOD *meth);
13
14  DSA_METHOD *DSA_get_default_method(void);
15
16  DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth);
17
18  DSA *DSA_new_method(DSA_METHOD *meth);
19
20  DSA_METHOD *DSA_OpenSSL(void);
21
22 =head1 DESCRIPTION
23
24 A B<DSA_METHOD> specifies the functions that OpenSSL uses for DSA
25 operations. By modifying the method, alternative implementations
26 such as hardware accelerators may be used.
27
28 Initially, the default is to use the OpenSSL internal implementation.
29 DSA_OpenSSL() returns a pointer to that method.
30
31 DSA_set_default_method() makes B<meth> the default method for all B<DSA>
32 structures created later.
33
34 DSA_get_default_method() returns a pointer to the current default
35 method.
36
37 DSA_set_method() selects B<meth> for all operations using the structure B<DSA>.
38
39 DSA_get_method() returns a pointer to the method currently selected
40 for B<DSA>.
41
42 DSA_new_method() allocates and initializes a B<DSA> structure so that
43 B<method> will be used for the DSA operations. If B<method> is B<NULL>,
44 the default method is used.
45
46 =head1 THE DSA_METHOD STRUCTURE
47
48 struct
49  {
50      /* name of the implementation */
51         const char *name;
52
53      /* sign */
54         DSA_SIG *(*dsa_do_sign)(const unsigned char *dgst, int dlen,
55                                  DSA *dsa);
56
57      /* pre-compute k^-1 and r */
58         int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
59                                  BIGNUM **rp);
60
61      /* verify */
62         int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len,
63                                  DSA_SIG *sig, DSA *dsa);
64
65      /* compute rr = a1^p1 * a2^p2 mod m. May be NULL */
66         int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
67                                  BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
68                                  BN_CTX *ctx, BN_MONT_CTX *in_mont);
69
70      /* compute r = a ^ p mod m. May be NULL */
71         int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a,
72                                  const BIGNUM *p, const BIGNUM *m,
73                                  BN_CTX *ctx, BN_MONT_CTX *m_ctx);
74
75      /* called at DSA_new */
76         int (*init)(DSA *DSA);
77
78      /* called at DSA_free */
79         int (*finish)(DSA *DSA);
80
81         int flags;
82
83         char *app_data; /* ?? */
84
85  } DSA_METHOD;
86
87 =head1 RETURN VALUES
88
89 DSA_OpenSSL(), DSA_get_default_method() and DSA_get_method() return
90 pointers to the respective B<DSA_METHOD>s.
91
92 DSA_set_default_method() returns no value.
93
94 DSA_set_method() returns a pointer to the B<DSA_METHOD> previously
95 associated with B<dsa>.
96
97 DSA_new_method() returns B<NULL> and sets an error code that can be
98 obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation
99 fails. Otherwise it returns a pointer to the newly allocated
100 structure.
101
102 =head1 SEE ALSO
103
104 L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)>
105
106 =head1 HISTORY
107
108 DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(),
109 DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4.
110
111 =cut