5 DSA_set_default_method, DSA_get_default_method, DSA_set_method,
6 DSA_new_method, DSA_OpenSSL - select RSA method
10 #include <openssl/DSA.h>
12 void DSA_set_default_method(DSA_METHOD *meth);
14 DSA_METHOD *DSA_get_default_method(void);
16 DSA_METHOD *DSA_set_method(DSA *dsa, DSA_METHOD *meth);
18 DSA *DSA_new_method(DSA_METHOD *meth);
20 DSA_METHOD *DSA_OpenSSL(void);
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.
28 Initially, the default is to use the OpenSSL internal implementation.
29 DSA_OpenSSL() returns a pointer to that method.
31 DSA_set_default_method() makes B<meth> the default method for all B<DSA>
32 structures created later.
34 DSA_get_default_method() returns a pointer to the current default
37 DSA_set_method() selects B<meth> for all operations using the structure B<DSA>.
39 DSA_get_method() returns a pointer to the method currently selected
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.
46 =head1 THE DSA_METHOD STRUCTURE
50 /* name of the implementation */
54 DSA_SIG *(*dsa_do_sign)(const unsigned char *dgst, int dlen,
57 /* pre-compute k^-1 and r */
58 int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
62 int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len,
63 DSA_SIG *sig, DSA *dsa);
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);
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);
75 /* called at DSA_new */
76 int (*init)(DSA *DSA);
78 /* called at DSA_free */
79 int (*finish)(DSA *DSA);
83 char *app_data; /* ?? */
89 DSA_OpenSSL(), DSA_get_default_method() and DSA_get_method() return
90 pointers to the respective B<DSA_METHOD>s.
92 DSA_set_default_method() returns no value.
94 DSA_set_method() returns a pointer to the B<DSA_METHOD> previously
95 associated with B<dsa>.
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
104 L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)>
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.