68 #include <openssl/e_os2.h>
71 #error DSA is disabled.
74 #ifndef OPENSSL_NO_BIO
75 #include <openssl/bio.h>
77 #include <openssl/crypto.h>
78 #include <openssl/ossl_typ.h>
80 #ifndef OPENSSL_NO_DEPRECATED
81 #include <openssl/bn.h>
83 # include <openssl/dh.h>
87 #ifndef OPENSSL_DSA_MAX_MODULUS_BITS
88 # define OPENSSL_DSA_MAX_MODULUS_BITS 10000
91 #define DSA_FLAG_CACHE_MONT_P 0x01
92 #define DSA_FLAG_NO_EXP_CONSTTIME 0x02
117 DSA_SIG * (*dsa_do_sign)(
const unsigned char *dgst,
int dlen,
DSA *dsa);
120 int (*dsa_do_verify)(
const unsigned char *dgst,
int dgst_len,
128 int (*init)(
DSA *dsa);
129 int (*finish)(
DSA *dsa);
133 int (*dsa_paramgen)(
DSA *dsa,
int bits,
134 unsigned char *seed,
int seed_len,
135 int *counter_ret,
unsigned long *h_ret,
138 int (*dsa_keygen)(
DSA *dsa);
168 #define DSAparams_dup(x) ASN1_dup_of_const(DSA,i2d_DSAparams,d2i_DSAparams,x)
169 #define d2i_DSAparams_fp(fp,x) (DSA *)ASN1_d2i_fp((char *(*)())DSA_new, \
170 (char *(*)())d2i_DSAparams,(fp),(unsigned char **)(x))
171 #define i2d_DSAparams_fp(fp,x) ASN1_i2d_fp(i2d_DSAparams,(fp), \
172 (unsigned char *)(x))
173 #define d2i_DSAparams_bio(bp,x) ASN1_d2i_bio_of(DSA,DSA_new,d2i_DSAparams,bp,x)
174 #define i2d_DSAparams_bio(bp,x) ASN1_i2d_bio_of_const(DSA,i2d_DSAparams,bp,x)
179 int i2d_DSA_SIG(
const DSA_SIG *a,
unsigned char **pp);
180 DSA_SIG * d2i_DSA_SIG(
DSA_SIG **v,
const unsigned char **pp,
long length);
182 DSA_SIG * DSA_do_sign(
const unsigned char *dgst,
int dlen,
DSA *dsa);
183 int DSA_do_verify(
const unsigned char *dgst,
int dgst_len,
188 void DSA_set_default_method(
const DSA_METHOD *);
189 const DSA_METHOD *DSA_get_default_method(
void);
194 void DSA_free (
DSA *r);
196 int DSA_up_ref(
DSA *r);
197 int DSA_size(
const DSA *);
200 int DSA_sign(
int type,
const unsigned char *dgst,
int dlen,
201 unsigned char *sig,
unsigned int *siglen,
DSA *dsa);
202 int DSA_verify(
int type,
const unsigned char *dgst,
int dgst_len,
203 const unsigned char *sigbuf,
int siglen,
DSA *dsa);
204 int DSA_get_ex_new_index(
long argl,
void *argp, CRYPTO_EX_new *new_func,
205 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
206 int DSA_set_ex_data(
DSA *d,
int idx,
void *arg);
207 void *DSA_get_ex_data(
DSA *d,
int idx);
209 DSA * d2i_DSAPublicKey(
DSA **a,
const unsigned char **pp,
long length);
210 DSA * d2i_DSAPrivateKey(
DSA **a,
const unsigned char **pp,
long length);
211 DSA * d2i_DSAparams(
DSA **a,
const unsigned char **pp,
long length);
214 #ifndef OPENSSL_NO_DEPRECATED
215 DSA * DSA_generate_parameters(
int bits,
216 unsigned char *seed,
int seed_len,
217 int *counter_ret,
unsigned long *h_ret,
void
218 (*callback)(
int,
int,
void *),
void *cb_arg);
222 int DSA_generate_parameters_ex(
DSA *dsa,
int bits,
223 unsigned char *seed,
int seed_len,
224 int *counter_ret,
unsigned long *h_ret,
BN_GENCB *cb);
226 int DSA_generate_key(
DSA *a);
227 int i2d_DSAPublicKey(
const DSA *a,
unsigned char **pp);
228 int i2d_DSAPrivateKey(
const DSA *a,
unsigned char **pp);
229 int i2d_DSAparams(
const DSA *a,
unsigned char **pp);
231 #ifndef OPENSSL_NO_BIO
232 int DSAparams_print(
BIO *bp,
const DSA *x);
233 int DSA_print(
BIO *bp,
const DSA *x,
int off);
235 #ifndef OPENSSL_NO_FP_API
236 int DSAparams_print_fp(FILE *fp,
const DSA *x);
237 int DSA_print_fp(FILE *bp,
const DSA *x,
int off);
240 #define DSS_prime_checks 50
243 #define DSA_is_prime(n, callback, cb_arg) \
244 BN_is_prime(n, DSS_prime_checks, callback, NULL, cb_arg)
246 #ifndef OPENSSL_NO_DH
249 DH *DSA_dup_DH(
const DSA *r);
256 void ERR_load_DSA_strings(
void);
261 #define DSA_F_D2I_DSA_SIG 110
262 #define DSA_F_DSAPARAMS_PRINT 100
263 #define DSA_F_DSAPARAMS_PRINT_FP 101
264 #define DSA_F_DSA_DO_SIGN 112
265 #define DSA_F_DSA_DO_VERIFY 113
266 #define DSA_F_DSA_NEW_METHOD 103
267 #define DSA_F_DSA_PRINT 104
268 #define DSA_F_DSA_PRINT_FP 105
269 #define DSA_F_DSA_SIGN 106
270 #define DSA_F_DSA_SIGN_SETUP 107
271 #define DSA_F_DSA_SIG_NEW 109
272 #define DSA_F_DSA_VERIFY 108
273 #define DSA_F_I2D_DSA_SIG 111
274 #define DSA_F_SIG_CB 114
277 #define DSA_R_BAD_Q_VALUE 102
278 #define DSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE 100
279 #define DSA_R_MISSING_PARAMETERS 101
280 #define DSA_R_MODULUS_TOO_LARGE 103
Definition: eng_int.h:148