diff options
Diffstat (limited to 'src/lib/libcrypto/dh/dh_local.h')
| -rw-r--r-- | src/lib/libcrypto/dh/dh_local.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/src/lib/libcrypto/dh/dh_local.h b/src/lib/libcrypto/dh/dh_local.h index 21bc266a9c..928f2c0c8b 100644 --- a/src/lib/libcrypto/dh/dh_local.h +++ b/src/lib/libcrypto/dh/dh_local.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: dh_local.h,v 1.2 2022/01/10 12:00:52 tb Exp $ */ | 1 | /* $OpenBSD: dh_local.h,v 1.3 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 | * |
| @@ -61,6 +61,48 @@ | |||
| 61 | 61 | ||
| 62 | __BEGIN_HIDDEN_DECLS | 62 | __BEGIN_HIDDEN_DECLS |
| 63 | 63 | ||
| 64 | struct dh_method { | ||
| 65 | const char *name; | ||
| 66 | /* Methods here */ | ||
| 67 | int (*generate_key)(DH *dh); | ||
| 68 | int (*compute_key)(unsigned char *key,const BIGNUM *pub_key,DH *dh); | ||
| 69 | int (*bn_mod_exp)(const DH *dh, BIGNUM *r, const BIGNUM *a, | ||
| 70 | const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); | ||
| 71 | int (*init)(DH *dh); | ||
| 72 | int (*finish)(DH *dh); | ||
| 73 | int flags; | ||
| 74 | char *app_data; | ||
| 75 | /* If this is non-NULL, it will be used to generate parameters */ | ||
| 76 | int (*generate_params)(DH *dh, int prime_len, int generator, | ||
| 77 | BN_GENCB *cb); | ||
| 78 | }; | ||
| 79 | |||
| 80 | struct dh_st { | ||
| 81 | /* This first argument is used to pick up errors when | ||
| 82 | * a DH is passed instead of a EVP_PKEY */ | ||
| 83 | int pad; | ||
| 84 | int version; | ||
| 85 | BIGNUM *p; | ||
| 86 | BIGNUM *g; | ||
| 87 | long length; /* optional */ | ||
| 88 | BIGNUM *pub_key; /* g^x */ | ||
| 89 | BIGNUM *priv_key; /* x */ | ||
| 90 | |||
| 91 | int flags; | ||
| 92 | BN_MONT_CTX *method_mont_p; | ||
| 93 | /* Place holders if we want to do X9.42 DH */ | ||
| 94 | BIGNUM *q; | ||
| 95 | BIGNUM *j; | ||
| 96 | unsigned char *seed; | ||
| 97 | int seedlen; | ||
| 98 | BIGNUM *counter; | ||
| 99 | |||
| 100 | int references; | ||
| 101 | CRYPTO_EX_DATA ex_data; | ||
| 102 | const DH_METHOD *meth; | ||
| 103 | ENGINE *engine; | ||
| 104 | }; | ||
| 105 | |||
| 64 | /* | 106 | /* |
| 65 | * Public API in OpenSSL that we only want to use internally. | 107 | * Public API in OpenSSL that we only want to use internally. |
| 66 | */ | 108 | */ |
