diff options
author | tb <> | 2022-01-14 08:27:23 +0000 |
---|---|---|
committer | tb <> | 2022-01-14 08:27:23 +0000 |
commit | 96b331528b7ab48983a3d8cb43fcf82cd8f322c3 (patch) | |
tree | 71161a354db4333f0f856767582e36e074e5c501 /src/lib/libcrypto/dsa/dsa_locl.h | |
parent | 3412d1fdfdf8698f7e998e555ec4ce73e1d6559f (diff) | |
download | openbsd-96b331528b7ab48983a3d8cb43fcf82cd8f322c3.tar.gz openbsd-96b331528b7ab48983a3d8cb43fcf82cd8f322c3.tar.bz2 openbsd-96b331528b7ab48983a3d8cb43fcf82cd8f322c3.zip |
Make DSA opaque
This moves DSA_SIG, DSA and DSA_METHOD to dsa_locl.h.
ok inoguchi jsing
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_locl.h')
-rw-r--r-- | src/lib/libcrypto/dsa/dsa_locl.h | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_locl.h b/src/lib/libcrypto/dsa/dsa_locl.h index cdb38e036b..29a3901dc7 100644 --- a/src/lib/libcrypto/dsa/dsa_locl.h +++ b/src/lib/libcrypto/dsa/dsa_locl.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: dsa_locl.h,v 1.3 2016/12/21 15:49:29 jsing Exp $ */ | 1 | /* $OpenBSD: dsa_locl.h,v 1.4 2022/01/14 08:27:23 tb Exp $ */ |
2 | /* ==================================================================== | 2 | /* ==================================================================== |
3 | * Copyright (c) 2007 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2007 The OpenSSL Project. All rights reserved. |
4 | * | 4 | * |
@@ -57,6 +57,60 @@ | |||
57 | 57 | ||
58 | __BEGIN_HIDDEN_DECLS | 58 | __BEGIN_HIDDEN_DECLS |
59 | 59 | ||
60 | struct DSA_SIG_st { | ||
61 | BIGNUM *r; | ||
62 | BIGNUM *s; | ||
63 | } /* DSA_SIG */; | ||
64 | |||
65 | struct dsa_method { | ||
66 | const char *name; | ||
67 | DSA_SIG *(*dsa_do_sign)(const unsigned char *dgst, int dlen, DSA *dsa); | ||
68 | int (*dsa_sign_setup)(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, | ||
69 | BIGNUM **rp); | ||
70 | int (*dsa_do_verify)(const unsigned char *dgst, int dgst_len, | ||
71 | DSA_SIG *sig, DSA *dsa); | ||
72 | int (*dsa_mod_exp)(DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, | ||
73 | BIGNUM *a2, BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, | ||
74 | BN_MONT_CTX *in_mont); | ||
75 | int (*bn_mod_exp)(DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, | ||
76 | const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); /* Can be null */ | ||
77 | int (*init)(DSA *dsa); | ||
78 | int (*finish)(DSA *dsa); | ||
79 | int flags; | ||
80 | char *app_data; | ||
81 | /* If this is non-NULL, it is used to generate DSA parameters */ | ||
82 | int (*dsa_paramgen)(DSA *dsa, int bits, const unsigned char *seed, | ||
83 | int seed_len, int *counter_ret, unsigned long *h_ret, BN_GENCB *cb); | ||
84 | /* If this is non-NULL, it is used to generate DSA keys */ | ||
85 | int (*dsa_keygen)(DSA *dsa); | ||
86 | } /* DSA_METHOD */; | ||
87 | |||
88 | struct dsa_st { | ||
89 | /* This first variable is used to pick up errors where | ||
90 | * a DSA is passed instead of of a EVP_PKEY */ | ||
91 | int pad; | ||
92 | long version; | ||
93 | int write_params; | ||
94 | BIGNUM *p; | ||
95 | BIGNUM *q; /* == 20 */ | ||
96 | BIGNUM *g; | ||
97 | |||
98 | BIGNUM *pub_key; /* y public key */ | ||
99 | BIGNUM *priv_key; /* x private key */ | ||
100 | |||
101 | BIGNUM *kinv; /* Signing pre-calc */ | ||
102 | BIGNUM *r; /* Signing pre-calc */ | ||
103 | |||
104 | int flags; | ||
105 | /* Normally used to cache montgomery values */ | ||
106 | BN_MONT_CTX *method_mont_p; | ||
107 | int references; | ||
108 | CRYPTO_EX_DATA ex_data; | ||
109 | const DSA_METHOD *meth; | ||
110 | /* functional reference if 'meth' is ENGINE-provided */ | ||
111 | ENGINE *engine; | ||
112 | } /* DSA */; | ||
113 | |||
60 | int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, | 114 | int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, |
61 | const EVP_MD *evpmd, const unsigned char *seed_in, size_t seed_len, | 115 | const EVP_MD *evpmd, const unsigned char *seed_in, size_t seed_len, |
62 | unsigned char *seed_out, | 116 | unsigned char *seed_out, |