5 DSA_set_default_method, DSA_get_default_method, DSA_set_method,
6 DSA_new_method, DSA_OpenSSL - select DSA 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_new_method() allocates and initializes a B<DSA> structure so that
40 B<method> will be used for the DSA operations. If B<method> is B<NULL>,
41 the default method is used.
43 =head1 THE DSA_METHOD STRUCTURE
47 /* name of the implementation */
51 DSA_SIG *(*dsa_do_sign)(const unsigned char *dgst, int dlen,
54 /* pre-compute k^-1 and r */
55 int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
59 int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len,
60 DSA_SIG *sig, DSA *dsa);
62 /* compute rr = a1^p1 * a2^p2 mod m (May be NULL for some
64 int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
65 BIGNUM *a2, BIGNUM *p2, BIGNUM *m,
66 BN_CTX *ctx, BN_MONT_CTX *in_mont);
68 /* compute r = a ^ p mod m (May be NULL for some implementations) */
69 int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a,
70 const BIGNUM *p, const BIGNUM *m,
71 BN_CTX *ctx, BN_MONT_CTX *m_ctx);
73 /* called at DSA_new */
74 int (*init)(DSA *DSA);
76 /* called at DSA_free */
77 int (*finish)(DSA *DSA);
81 char *app_data; /* ?? */
87 DSA_OpenSSL() and DSA_get_default_method() return pointers to the
88 respective B<DSA_METHOD>s.
90 DSA_set_default_method() returns no value.
92 DSA_set_method() returns a pointer to the B<DSA_METHOD> previously
93 associated with B<dsa>.
95 DSA_new_method() returns B<NULL> and sets an error code that can be
96 obtained by L<ERR_get_error(3)|ERR_get_error(3)> if the allocation
97 fails. Otherwise it returns a pointer to the newly allocated
102 L<dsa(3)|dsa(3)>, L<DSA_new(3)|DSA_new(3)>
106 DSA_set_default_method(), DSA_get_default_method(), DSA_set_method(),
107 DSA_new_method() and DSA_OpenSSL() were added in OpenSSL 0.9.4.