summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dh/dh.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dh/dh.h')
-rw-r--r--src/lib/libcrypto/dh/dh.h51
1 files changed, 1 insertions, 50 deletions
diff --git a/src/lib/libcrypto/dh/dh.h b/src/lib/libcrypto/dh/dh.h
index 4545035afb..ef10495029 100644
--- a/src/lib/libcrypto/dh/dh.h
+++ b/src/lib/libcrypto/dh/dh.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: dh.h,v 1.31 2022/01/14 07:49:49 tb Exp $ */ 1/* $OpenBSD: dh.h,v 1.32 2022/01/14 08:25:44 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 *
@@ -98,55 +98,6 @@
98extern "C" { 98extern "C" {
99#endif 99#endif
100 100
101/* Already defined in ossl_typ.h */
102/* typedef struct dh_st DH; */
103/* typedef struct dh_method DH_METHOD; */
104
105struct dh_method
106 {
107 const char *name;
108 /* Methods here */
109 int (*generate_key)(DH *dh);
110 int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh);
111 int (*bn_mod_exp)(const DH *dh, BIGNUM *r, const BIGNUM *a,
112 const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx,
113 BN_MONT_CTX *m_ctx); /* Can be null */
114
115 int (*init)(DH *dh);
116 int (*finish)(DH *dh);
117 int flags;
118 char *app_data;
119 /* If this is non-NULL, it will be used to generate parameters */
120 int (*generate_params)(DH *dh, int prime_len, int generator, BN_GENCB *cb);
121 };
122
123struct dh_st
124 {
125 /* This first argument is used to pick up errors when
126 * a DH is passed instead of a EVP_PKEY */
127 int pad;
128 int version;
129 BIGNUM *p;
130 BIGNUM *g;
131 long length; /* optional */
132 BIGNUM *pub_key; /* g^x */
133 BIGNUM *priv_key; /* x */
134
135 int flags;
136 BN_MONT_CTX *method_mont_p;
137 /* Place holders if we want to do X9.42 DH */
138 BIGNUM *q;
139 BIGNUM *j;
140 unsigned char *seed;
141 int seedlen;
142 BIGNUM *counter;
143
144 int references;
145 CRYPTO_EX_DATA ex_data;
146 const DH_METHOD *meth;
147 ENGINE *engine;
148 };
149
150#define DH_GENERATOR_2 2 101#define DH_GENERATOR_2 2
151/* #define DH_GENERATOR_3 3 */ 102/* #define DH_GENERATOR_3 3 */
152#define DH_GENERATOR_5 5 103#define DH_GENERATOR_5 5