summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa.h')
-rw-r--r--src/lib/libcrypto/dsa/dsa.h66
1 files changed, 2 insertions, 64 deletions
diff --git a/src/lib/libcrypto/dsa/dsa.h b/src/lib/libcrypto/dsa/dsa.h
index b0220856cc..4fafce382d 100644
--- a/src/lib/libcrypto/dsa/dsa.h
+++ b/src/lib/libcrypto/dsa/dsa.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa.h,v 1.34 2022/01/14 07:49:49 tb Exp $ */ 1/* $OpenBSD: dsa.h,v 1.35 2022/01/14 08:27:23 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -109,69 +109,7 @@
109extern "C" { 109extern "C" {
110#endif 110#endif
111 111
112/* Already defined in ossl_typ.h */ 112typedef struct DSA_SIG_st DSA_SIG;
113/* typedef struct dsa_st DSA; */
114/* typedef struct dsa_method DSA_METHOD; */
115
116typedef struct DSA_SIG_st
117 {
118 BIGNUM *r;
119 BIGNUM *s;
120 } DSA_SIG;
121
122struct dsa_method
123 {
124 const char *name;
125 DSA_SIG * (*dsa_do_sign)(const unsigned char *dgst, int dlen, DSA *dsa);
126 int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp,
127 BIGNUM **rp);
128 int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len,
129 DSA_SIG *sig, DSA *dsa);
130 int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1,
131 BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx,
132 BN_MONT_CTX *in_mont);
133 int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p,
134 const BIGNUM *m, BN_CTX *ctx,
135 BN_MONT_CTX *m_ctx); /* Can be null */
136 int (*init)(DSA *dsa);
137 int (*finish)(DSA *dsa);
138 int flags;
139 char *app_data;
140 /* If this is non-NULL, it is used to generate DSA parameters */
141 int (*dsa_paramgen)(DSA *dsa, int bits,
142 const unsigned char *seed, int seed_len,
143 int *counter_ret, unsigned long *h_ret,
144 BN_GENCB *cb);
145 /* If this is non-NULL, it is used to generate DSA keys */
146 int (*dsa_keygen)(DSA *dsa);
147 };
148
149struct dsa_st
150 {
151 /* This first variable is used to pick up errors where
152 * a DSA is passed instead of of a EVP_PKEY */
153 int pad;
154 long version;
155 int write_params;
156 BIGNUM *p;
157 BIGNUM *q; /* == 20 */
158 BIGNUM *g;
159
160 BIGNUM *pub_key; /* y public key */
161 BIGNUM *priv_key; /* x private key */
162
163 BIGNUM *kinv; /* Signing pre-calc */
164 BIGNUM *r; /* Signing pre-calc */
165
166 int flags;
167 /* Normally used to cache montgomery values */
168 BN_MONT_CTX *method_mont_p;
169 int references;
170 CRYPTO_EX_DATA ex_data;
171 const DSA_METHOD *meth;
172 /* functional reference if 'meth' is ENGINE-provided */
173 ENGINE *engine;
174 };
175 113
176DSA *d2i_DSAparams_bio(BIO *bp, DSA **a); 114DSA *d2i_DSAparams_bio(BIO *bp, DSA **a);
177int i2d_DSAparams_bio(BIO *bp, DSA *a); 115int i2d_DSAparams_bio(BIO *bp, DSA *a);