Go to the documentation of this file.
65 #error DH is disabled.
68 #ifndef OPENSSL_NO_BIO
72 #ifndef OPENSSL_NO_DEPRECATED
76 #ifndef OPENSSL_DH_MAX_MODULUS_BITS
77 # define OPENSSL_DH_MAX_MODULUS_BITS 10000
80 #define DH_FLAG_CACHE_MONT_P 0x01
81 #define DH_FLAG_NO_EXP_CONSTTIME 0x02
95 #define DH_FLAG_FIPS_METHOD 0x0400
102 #define DH_FLAG_NON_FIPS_ALLOW 0x0400
157 #define DH_GENERATOR_2 2
159 #define DH_GENERATOR_5 5
162 #define DH_CHECK_P_NOT_PRIME 0x01
163 #define DH_CHECK_P_NOT_SAFE_PRIME 0x02
164 #define DH_UNABLE_TO_CHECK_GENERATOR 0x04
165 #define DH_NOT_SUITABLE_GENERATOR 0x08
168 #define DH_CHECK_PUBKEY_TOO_SMALL 0x01
169 #define DH_CHECK_PUBKEY_TOO_LARGE 0x02
173 #define DH_CHECK_P_NOT_STRONG_PRIME DH_CHECK_P_NOT_SAFE_PRIME
175 #define d2i_DHparams_fp(fp,x) (DH *)ASN1_d2i_fp((char *(*)())DH_new, \
176 (char *(*)())d2i_DHparams,(fp),(unsigned char **)(x))
177 #define i2d_DHparams_fp(fp,x) ASN1_i2d_fp(i2d_DHparams,(fp), \
178 (unsigned char *)(x))
179 #define d2i_DHparams_bio(bp,x) ASN1_d2i_bio_of(DH,DH_new,d2i_DHparams,bp,x)
180 #define i2d_DHparams_bio(bp,x) ASN1_i2d_bio_of_const(DH,i2d_DHparams,bp,x)
201 #ifndef OPENSSL_NO_DEPRECATED
203 void (*
callback)(
int,
int,
void *),
void *cb_arg);
215 #ifndef OPENSSL_NO_FP_API
218 #ifndef OPENSSL_NO_BIO
224 #define EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, len) \
225 EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
226 EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN, len, NULL)
228 #define EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, gen) \
229 EVP_PKEY_CTX_ctrl(ctx, EVP_PKEY_DH, EVP_PKEY_OP_PARAMGEN, \
230 EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR, gen, NULL)
232 #define EVP_PKEY_CTRL_DH_PARAMGEN_PRIME_LEN (EVP_PKEY_ALG_CTRL + 1)
233 #define EVP_PKEY_CTRL_DH_PARAMGEN_GENERATOR (EVP_PKEY_ALG_CTRL + 2)
245 #define DH_F_COMPUTE_KEY 102
246 #define DH_F_DHPARAMS_PRINT_FP 101
247 #define DH_F_DH_BUILTIN_GENPARAMS 106
248 #define DH_F_DH_COMPUTE_KEY 114
249 #define DH_F_DH_GENERATE_KEY 115
250 #define DH_F_DH_GENERATE_PARAMETERS_EX 116
251 #define DH_F_DH_NEW_METHOD 105
252 #define DH_F_DH_PARAM_DECODE 107
253 #define DH_F_DH_PRIV_DECODE 110
254 #define DH_F_DH_PRIV_ENCODE 111
255 #define DH_F_DH_PUB_DECODE 108
256 #define DH_F_DH_PUB_ENCODE 109
257 #define DH_F_DO_DH_PRINT 100
258 #define DH_F_GENERATE_KEY 103
259 #define DH_F_GENERATE_PARAMETERS 104
260 #define DH_F_PKEY_DH_DERIVE 112
261 #define DH_F_PKEY_DH_KEYGEN 113
264 #define DH_R_BAD_GENERATOR 101
265 #define DH_R_BN_DECODE_ERROR 109
266 #define DH_R_BN_ERROR 106
267 #define DH_R_DECODE_ERROR 104
268 #define DH_R_INVALID_PUBKEY 102
269 #define DH_R_KEYS_NOT_SET 108
270 #define DH_R_KEY_SIZE_TOO_SMALL 110
271 #define DH_R_MODULUS_TOO_LARGE 103
272 #define DH_R_NON_FIPS_METHOD 111
273 #define DH_R_NO_PARAMETERS_SET 107
274 #define DH_R_NO_PRIVATE_VALUE 100
275 #define DH_R_PARAMETER_ENCODING_ERROR 105