1DSA_METH_NEW(3ossl)                 OpenSSL                DSA_METH_NEW(3ossl)
2
3
4

NAME

6       DSA_meth_new, DSA_meth_free, DSA_meth_dup, DSA_meth_get0_name,
7       DSA_meth_set1_name, DSA_meth_get_flags, DSA_meth_set_flags,
8       DSA_meth_get0_app_data, DSA_meth_set0_app_data, DSA_meth_get_sign,
9       DSA_meth_set_sign, DSA_meth_get_sign_setup, DSA_meth_set_sign_setup,
10       DSA_meth_get_verify, DSA_meth_set_verify, DSA_meth_get_mod_exp,
11       DSA_meth_set_mod_exp, DSA_meth_get_bn_mod_exp, DSA_meth_set_bn_mod_exp,
12       DSA_meth_get_init, DSA_meth_set_init, DSA_meth_get_finish,
13       DSA_meth_set_finish, DSA_meth_get_paramgen, DSA_meth_set_paramgen,
14       DSA_meth_get_keygen, DSA_meth_set_keygen - Routines to build up DSA
15       methods
16

SYNOPSIS

18        #include <openssl/dsa.h>
19
20       The following functions have been deprecated since OpenSSL 3.0, and can
21       be hidden entirely by defining OPENSSL_API_COMPAT with a suitable
22       version value, see openssl_user_macros(7):
23
24        DSA_METHOD *DSA_meth_new(const char *name, int flags);
25
26        void DSA_meth_free(DSA_METHOD *dsam);
27
28        DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth);
29
30        const char *DSA_meth_get0_name(const DSA_METHOD *dsam);
31        int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name);
32
33        int DSA_meth_get_flags(const DSA_METHOD *dsam);
34        int DSA_meth_set_flags(DSA_METHOD *dsam, int flags);
35
36        void *DSA_meth_get0_app_data(const DSA_METHOD *dsam);
37        int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data);
38
39        DSA_SIG *(*DSA_meth_get_sign(const DSA_METHOD *dsam))(const unsigned char *,
40                                                              int, DSA *);
41        int DSA_meth_set_sign(DSA_METHOD *dsam, DSA_SIG *(*sign)(const unsigned char *,
42                                                                 int, DSA *));
43
44        int (*DSA_meth_get_sign_setup(const DSA_METHOD *dsam))(DSA *, BN_CTX *,$
45                                                               BIGNUM **, BIGNUM **);
46        int DSA_meth_set_sign_setup(DSA_METHOD *dsam, int (*sign_setup)(DSA *, BN_CTX *,
47                                                                        BIGNUM **, BIGNUM **));
48
49        int (*DSA_meth_get_verify(const DSA_METHOD *dsam))(const unsigned char *,
50                                                           int, DSA_SIG *, DSA *);
51        int DSA_meth_set_verify(DSA_METHOD *dsam, int (*verify)(const unsigned char *,
52                                                                int, DSA_SIG *, DSA *));
53
54        int (*DSA_meth_get_mod_exp(const DSA_METHOD *dsam))(DSA *dsa, BIGNUM *rr, BIGNUM *a1,
55                                                            BIGNUM *p1, BIGNUM *a2, BIGNUM *p2,
56                                                            BIGNUM *m, BN_CTX *ctx,
57                                                            BN_MONT_CTX *in_mont);
58        int DSA_meth_set_mod_exp(DSA_METHOD *dsam, int (*mod_exp)(DSA *dsa, BIGNUM *rr,
59                                                                  BIGNUM *a1, BIGNUM *p1,
60                                                                  BIGNUM *a2, BIGNUM *p2,
61                                                                  BIGNUM *m, BN_CTX *ctx,
62                                                                  BN_MONT_CTX *mont));
63
64        int (*DSA_meth_get_bn_mod_exp(const DSA_METHOD *dsam))(DSA *dsa, BIGNUM *r, BIGNUM *a,
65                                                               const BIGNUM *p, const BIGNUM *m,
66                                                               BN_CTX *ctx, BN_MONT_CTX *mont);
67        int DSA_meth_set_bn_mod_exp(DSA_METHOD *dsam, int (*bn_mod_exp)(DSA *dsa,
68                                                                        BIGNUM *r,
69                                                                        BIGNUM *a,
70                                                                        const BIGNUM *p,
71                                                                        const BIGNUM *m,
72                                                                        BN_CTX *ctx,
73                                                                        BN_MONT_CTX *mont));
74
75        int (*DSA_meth_get_init(const DSA_METHOD *dsam))(DSA *);
76        int DSA_meth_set_init(DSA_METHOD *dsam, int (*init)(DSA *));
77
78        int (*DSA_meth_get_finish(const DSA_METHOD *dsam))(DSA *);
79        int DSA_meth_set_finish(DSA_METHOD *dsam, int (*finish)(DSA *));
80
81        int (*DSA_meth_get_paramgen(const DSA_METHOD *dsam))(DSA *, int,
82                                                             const unsigned char *,
83                                                             int, int *, unsigned long *,
84                                                             BN_GENCB *);
85        int DSA_meth_set_paramgen(DSA_METHOD *dsam,
86                                  int (*paramgen)(DSA *, int, const unsigned char *,
87                                                  int, int *, unsigned long *, BN_GENCB *));
88
89        int (*DSA_meth_get_keygen(const DSA_METHOD *dsam))(DSA *);
90        int DSA_meth_set_keygen(DSA_METHOD *dsam, int (*keygen)(DSA *));
91

DESCRIPTION

93       All of the functions described on this page are deprecated.
94       Applications and extension implementations should instead use the
95       OSSL_PROVIDER APIs.
96
97       The DSA_METHOD type is a structure used for the provision of custom DSA
98       implementations. It provides a set of functions used by OpenSSL for the
99       implementation of the various DSA capabilities.
100
101       DSA_meth_new() creates a new DSA_METHOD structure. It should be given a
102       unique name and a set of flags. The name should be a NULL terminated
103       string, which will be duplicated and stored in the DSA_METHOD object.
104       It is the callers responsibility to free the original string. The flags
105       will be used during the construction of a new DSA object based on this
106       DSA_METHOD. Any new DSA object will have those flags set by default.
107
108       DSA_meth_dup() creates a duplicate copy of the DSA_METHOD object passed
109       as a parameter. This might be useful for creating a new DSA_METHOD
110       based on an existing one, but with some differences.
111
112       DSA_meth_free() destroys a DSA_METHOD structure and frees up any memory
113       associated with it.
114
115       DSA_meth_get0_name() will return a pointer to the name of this
116       DSA_METHOD. This is a pointer to the internal name string and so should
117       not be freed by the caller. DSA_meth_set1_name() sets the name of the
118       DSA_METHOD to name. The string is duplicated and the copy is stored in
119       the DSA_METHOD structure, so the caller remains responsible for freeing
120       the memory associated with the name.
121
122       DSA_meth_get_flags() returns the current value of the flags associated
123       with this DSA_METHOD. DSA_meth_set_flags() provides the ability to set
124       these flags.
125
126       The functions DSA_meth_get0_app_data() and DSA_meth_set0_app_data()
127       provide the ability to associate implementation specific data with the
128       DSA_METHOD. It is the application's responsibility to free this data
129       before the DSA_METHOD is freed via a call to DSA_meth_free().
130
131       DSA_meth_get_sign() and DSA_meth_set_sign() get and set the function
132       used for creating a DSA signature respectively. This function will be
133       called in response to the application calling DSA_do_sign() (or
134       DSA_sign()). The parameters for the function have the same meaning as
135       for DSA_do_sign().
136
137       DSA_meth_get_sign_setup() and DSA_meth_set_sign_setup() get and set the
138       function used for precalculating the DSA signature values k^-1 and r.
139       This function will be called in response to the application calling
140       DSA_sign_setup(). The parameters for the function have the same meaning
141       as for DSA_sign_setup().
142
143       DSA_meth_get_verify() and DSA_meth_set_verify() get and set the
144       function used for verifying a DSA signature respectively. This function
145       will be called in response to the application calling DSA_do_verify()
146       (or DSA_verify()). The parameters for the function have the same
147       meaning as for DSA_do_verify().
148
149       DSA_meth_get_mod_exp() and DSA_meth_set_mod_exp() get and set the
150       function used for computing the following value:
151
152        rr = a1^p1 * a2^p2 mod m
153
154       This function will be called by the default OpenSSL method during
155       verification of a DSA signature. The result is stored in the rr
156       parameter. This function may be NULL.
157
158       DSA_meth_get_bn_mod_exp() and DSA_meth_set_bn_mod_exp() get and set the
159       function used for computing the following value:
160
161        r = a ^ p mod m
162
163       This function will be called by the default OpenSSL function for
164       DSA_sign_setup(). The result is stored in the r parameter. This
165       function may be NULL.
166
167       DSA_meth_get_init() and DSA_meth_set_init() get and set the function
168       used for creating a new DSA instance respectively. This function will
169       be called in response to the application calling DSA_new() (if the
170       current default DSA_METHOD is this one) or DSA_new_method(). The
171       DSA_new() and DSA_new_method() functions will allocate the memory for
172       the new DSA object, and a pointer to this newly allocated structure
173       will be passed as a parameter to the function. This function may be
174       NULL.
175
176       DSA_meth_get_finish() and DSA_meth_set_finish() get and set the
177       function used for destroying an instance of a DSA object respectively.
178       This function will be called in response to the application calling
179       DSA_free(). A pointer to the DSA to be destroyed is passed as a
180       parameter. The destroy function should be used for DSA implementation
181       specific clean up. The memory for the DSA itself should not be freed by
182       this function. This function may be NULL.
183
184       DSA_meth_get_paramgen() and DSA_meth_set_paramgen() get and set the
185       function used for generating DSA parameters respectively. This function
186       will be called in response to the application calling
187       DSA_generate_parameters_ex() (or DSA_generate_parameters()). The
188       parameters for the function have the same meaning as for
189       DSA_generate_parameters_ex().
190
191       DSA_meth_get_keygen() and DSA_meth_set_keygen() get and set the
192       function used for generating a new DSA key pair respectively. This
193       function will be called in response to the application calling
194       DSA_generate_key(). The parameter for the function has the same meaning
195       as for DSA_generate_key().
196

RETURN VALUES

198       DSA_meth_new() and DSA_meth_dup() return the newly allocated DSA_METHOD
199       object or NULL on failure.
200
201       DSA_meth_get0_name() and DSA_meth_get_flags() return the name and flags
202       associated with the DSA_METHOD respectively.
203
204       All other DSA_meth_get_*() functions return the appropriate function
205       pointer that has been set in the DSA_METHOD, or NULL if no such pointer
206       has yet been set.
207
208       DSA_meth_set1_name() and all DSA_meth_set_*() functions return 1 on
209       success or 0 on failure.
210

SEE ALSO

212       DSA_new(3), DSA_new(3), DSA_generate_parameters(3),
213       DSA_generate_key(3), DSA_dup_DH(3), DSA_do_sign(3), DSA_set_method(3),
214       DSA_SIG_new(3), DSA_sign(3), DSA_size(3), DSA_get0_pqg(3)
215

HISTORY

217       The functions described here were deprecated in OpenSSL 3.0.
218
219       The functions described here were added in OpenSSL 1.1.0.
220
222       Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
223
224       Licensed under the Apache License 2.0 (the "License").  You may not use
225       this file except in compliance with the License.  You can obtain a copy
226       in the file LICENSE in the source distribution or at
227       <https://www.openssl.org/source/license.html>.
228
229
230
2313.0.9                             2023-07-27               DSA_METH_NEW(3ossl)
Impressum