Home
last modified time | relevance | path

Searched refs:dh (Results 1 – 25 of 72) sorted by relevance

123

/openssl/crypto/dh/
H A Ddh_key.c73 dh->lock, dh->params.p, ctx); in ossl_dh_compute_key()
80 if (!dh->meth->bn_mod_exp(dh, z, pub_key, dh->priv_key, dh->params.p, ctx, in ossl_dh_compute_key()
117 ret = dh->meth->compute_key(key, pub_key, dh); in DH_compute_key()
146 rv = dh->meth->compute_key(key, pub_key, dh); in DH_compute_key_padded()
194 dh->dirty_cnt++; in dh_init()
216 return dh->meth->generate_key(dh); in DH_generate_key()
247 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->params.g, prk, dh->params.p, in ossl_dh_generate_public_key()
303 || dh->length > BN_num_bits(dh->params.q)) in generate_key()
317 && dh->length >= BN_num_bits(dh->params.p)) in generate_key()
319 l = dh->length ? dh->length : BN_num_bits(dh->params.p) - 1; in generate_key()
[all …]
H A Ddh_lib.c39 mtmp = dh->meth; in DH_set_method()
41 mtmp->finish(dh); in DH_set_method()
44 dh->engine = NULL; in DH_set_method()
46 dh->meth = meth; in DH_set_method()
48 meth->init(dh); in DH_set_method()
54 return dh->meth; in ossl_dh_get_method()
237 dh->dirty_cnt++; in DH_set0_pqg()
243 return dh->length; in DH_get_length()
249 dh->dirty_cnt++; in DH_set_length()
272 dh->dirty_cnt++; in DH_set0_key()
[all …]
H A Ddh_check.c57 nid = DH_get_nid((DH *)dh); in DH_check_params()
65 return ossl_ffc_params_FIPS186_4_validate(dh->libctx, &dh->params, in DH_check_params()
111 int DH_check_ex(const DH *dh) in DH_check_ex() argument
167 if (dh->params.q != NULL) { in DH_check()
170 else if (BN_cmp(dh->params.g, dh->params.p) >= 0) in DH_check()
174 if (!BN_mod_exp(t1, dh->params.g, dh->params.q, dh->params.p, ctx)) in DH_check()
185 if (!BN_div(t1, t2, dh->params.p, dh->params.q, ctx)) in DH_check()
262 upper = dh->params.q; in ossl_dh_check_priv_key()
286 if (DH_get_nid((DH *)dh) != NID_undef && dh->length != 0) { in ossl_dh_check_priv_key()
311 if (dh->params.p == NULL in ossl_dh_check_pairwise()
[all …]
H A Ddh_group_params.c31 if (dh == NULL) in dh_param_init()
36 dh->dirty_cnt++; in dh_param_init()
37 return dh; in dh_param_init()
60 if (dh == NULL) in ossl_dh_cache_named_group()
66 if (dh->params.p == NULL in ossl_dh_cache_named_group()
67 || dh->params.g == NULL) in ossl_dh_cache_named_group()
78 dh->dirty_cnt++; in ossl_dh_cache_named_group()
84 int id = DH_get_nid(dh); in ossl_dh_is_named_safe_prime_group()
93 int DH_get_nid(const DH *dh) in DH_get_nid() argument
95 if (dh == NULL) in DH_get_nid()
[all …]
H A Ddh_ameth.c45 return dh; in d2i_dhp()
113 DH *dh; in dh_pub_encode() local
120 dh = pkey->pkey.dh; in dh_pub_encode()
230 DH *dh; in dh_param_decode() local
399 DH *dh; in dh_pkey_ctrl() local
430 DH *dh = pkey->pkey.dh; in dh_pkey_public_check() local
437 return DH_check_pub_key_ex(dh, dh->pub_key); in dh_pkey_public_check()
442 DH *dh = pkey->pkey.dh; in dh_pkey_param_check() local
456 DH *dh = from->pkey.dh; in dh_pkey_export_to() local
458 const BIGNUM *p = DH_get0_p(dh), *g = DH_get0_g(dh), *q = DH_get0_q(dh); in dh_pkey_export_to()
[all …]
H A Ddh_backend.c36 if (dh == NULL) in dh_ffc_params_fromdata()
71 if (dh == NULL) in ossl_dh_key_fromdata()
114 if (dh == NULL) in ossl_dh_key_todata()
132 if (dh->engine != NULL || ossl_dh_get_method(dh) != DH_OpenSSL()) in ossl_dh_is_foreign()
161 dupkey->flags = dh->flags; in ossl_dh_dup()
198 DH *dh = NULL; in ossl_dh_key_from_pkcs8() local
223 if (dh == NULL) in ossl_dh_key_from_pkcs8()
236 if (!DH_generate_key(dh)) in ossl_dh_key_from_pkcs8()
244 DH_free(dh); in ossl_dh_key_from_pkcs8()
245 dh = NULL; in ossl_dh_key_from_pkcs8()
[all …]
H A Ddh_rfc5114.c31 DH *dh = DH_new(); \
33 if (dh == NULL) \
35 dh->params.p = BN_dup(&ossl_bignum_dh##x##_p); \
36 dh->params.g = BN_dup(&ossl_bignum_dh##x##_g); \
37 dh->params.q = BN_dup(&ossl_bignum_dh##x##_q); \
38 if (dh->params.p == NULL || dh->params.q == NULL || dh->params.g == NULL) {\
39 DH_free(dh); \
42 return dh; \
H A Ddh_asn1.c38 DH *dh = (DH *)*pval; in dh_cb() local
42 ossl_dh_cache_named_group(dh); in dh_cb()
43 dh->dirty_cnt++; in dh_cb()
97 DH *dh = NULL; in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname() local
99 dh = DH_new(); in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname()
100 if (dh == NULL) in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname()
104 DH_free(dh); in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname()
110 *a = dh; in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname()
113 params = &dh->params; in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname()
131 DH_set_flags(dh, DH_FLAG_TYPE_DHX); in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname()
[all …]
H A Ddh_pmeth.c325 DH *dh = NULL; in pkey_dh_paramgen() local
356 if (dh == NULL) in pkey_dh_paramgen()
361 dh = DH_new(); in pkey_dh_paramgen()
362 if (dh == NULL) { in pkey_dh_paramgen()
370 EVP_PKEY_assign_DH(pkey, dh); in pkey_dh_paramgen()
372 DH_free(dh); in pkey_dh_paramgen()
379 DH *dh = NULL; in pkey_dh_keygen() local
388 dh = DH_new(); in pkey_dh_keygen()
389 if (dh == NULL) in pkey_dh_keygen()
402 DH *dh; in pkey_dh_derive() local
[all …]
H A Ddh_gen.c39 int ossl_dh_generate_ffc_parameters(DH *dh, int type, int pbits, int qbits, in ossl_dh_generate_ffc_parameters() argument
46 ret = ossl_ffc_params_FIPS186_2_generate(dh->libctx, &dh->params, in ossl_dh_generate_ffc_parameters()
51 ret = ossl_ffc_params_FIPS186_4_generate(dh->libctx, &dh->params, in ossl_dh_generate_ffc_parameters()
55 dh->dirty_cnt++; in ossl_dh_generate_ffc_parameters()
97 DH *dh; in dh_gen_named_group() local
104 dh = ossl_dh_new_by_nid_ex(libctx, nid); in dh_gen_named_group()
105 if (dh != NULL in dh_gen_named_group()
106 && ossl_ffc_params_copy(&ret->params, &dh->params)) { in dh_gen_named_group()
110 DH_free(dh); in dh_gen_named_group()
H A Ddh_local.h46 int (*generate_key) (DH *dh);
47 int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh);
50 int (*bn_mod_exp) (const DH *dh, BIGNUM *r, const BIGNUM *a,
53 int (*init) (DH *dh);
54 int (*finish) (DH *dh);
58 int (*generate_params) (DH *dh, int prime_len, int generator,
/openssl/include/crypto/
H A Ddh.h24 int ossl_dh_generate_public_key(BN_CTX *ctx, const DH *dh,
29 void ossl_dh_cache_named_group(DH *dh);
30 int ossl_dh_is_named_safe_prime_group(const DH *dh);
32 FFC_PARAMS *ossl_dh_get0_params(DH *dh);
33 int ossl_dh_get0_nid(const DH *dh);
34 int ossl_dh_params_fromdata(DH *dh, const OSSL_PARAM params[]);
37 int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[],
45 int ossl_dh_check_pairwise(const DH *dh);
47 const DH_METHOD *ossl_dh_get_method(const DH *dh);
59 int ossl_dh_is_foreign(const DH *dh);
[all …]
/openssl/providers/implementations/keymgmt/
H A Ddh_kmgmt.c100 DH *dh = NULL; in dh_newdata() local
109 return dh; in dh_newdata()
114 DH *dh = NULL; in dhx_newdata() local
117 if (dh != NULL) { in dhx_newdata()
121 return dh; in dhx_newdata()
144 ok = ok && (DH_get0_p(dh) != NULL && DH_get0_g(dh) != NULL); in dh_has()
313 DH *dh = key; in dh_get_params() local
366 DH *dh = key; in dh_set_params() local
691 DH *dh = NULL; in dh_gen() local
783 dh = NULL; in dh_gen()
[all …]
/openssl/include/openssl/
H A Ddh.h203 OSSL_DEPRECATEDIN_3_0 void DH_free(DH *dh);
204 OSSL_DEPRECATEDIN_3_0 int DH_up_ref(DH *dh);
205 OSSL_DEPRECATEDIN_3_0 int DH_bits(const DH *dh);
206 OSSL_DEPRECATEDIN_3_0 int DH_size(const DH *dh);
207 OSSL_DEPRECATEDIN_3_0 int DH_security_bits(const DH *dh);
219 OSSL_DEPRECATEDIN_3_0 int DH_check_params_ex(const DH *dh);
220 OSSL_DEPRECATEDIN_3_0 int DH_check_ex(const DH *dh);
226 OSSL_DEPRECATEDIN_3_0 int DH_generate_key(DH *dh);
247 OSSL_DEPRECATEDIN_3_0 int DH_get_nid(const DH *dh);
269 OSSL_DEPRECATEDIN_3_0 void DH_set_flags(DH *dh, int flags);
[all …]
/openssl/test/
H A Ddhtest.c39 DH *dh = NULL; in dh_test() local
57 if (!TEST_ptr(dh = DH_new()) in dh_test()
76 if (!DH_check(dh, &i)) in dh_test()
92 DH_get0_pqg(dh, &p2, &q2, &g2); in dh_test()
229 DH_free(dh); in dh_test()
242 DH *dh = NULL; in dh_computekey_range_test() local
249 || !TEST_ptr(dh = DH_new()) in dh_computekey_range_test()
293 DH_free(dh); in dh_computekey_range_test()
711 DH *dh = NULL; in dh_test_prime_groups() local
716 DH_get0_pqg(dh, &p, &q, &g); in dh_test_prime_groups()
[all …]
H A Dpem_read_depr_test.c45 DH *dh = NULL; in test_read_dh_params() local
50 dh = PEM_read_bio_DHparams(infile, NULL, NULL, NULL); in test_read_dh_params()
51 if (!TEST_ptr(dh)) in test_read_dh_params()
58 DH_free(dh); in test_read_dh_params()
66 DH *dh = NULL; in test_read_dh_x942_params() local
71 dh = PEM_read_bio_DHparams(infile, NULL, NULL, NULL); in test_read_dh_x942_params()
72 if (!TEST_ptr(dh)) in test_read_dh_x942_params()
79 DH_free(dh); in test_read_dh_x942_params()
H A Dffc_internal_test.c446 DH *dh = NULL; in ffc_public_validate_test() local
453 params = ossl_dh_get0_params(dh); in ffc_public_validate_test()
515 DH_free(dh); in ffc_public_validate_test()
525 DH *dh = NULL; in ffc_private_validate_test() local
532 params = ossl_dh_get0_params(dh); in ffc_private_validate_test()
572 DH_free(dh); in ffc_private_validate_test()
582 DH *dh = NULL; in ffc_private_gen_test() local
593 params = ossl_dh_get0_params(dh); in ffc_private_gen_test()
628 DH_free(dh); in ffc_private_gen_test()
637 DH *dh = NULL; in ffc_params_copy_test() local
[all …]
/openssl/doc/man3/
H A DDH_size.pod10 #include <openssl/dh.h>
16 int DH_bits(const DH *dh);
18 int DH_size(const DH *dh);
20 int DH_security_bits(const DH *dh);
30 B<dh> and B<dh-E<gt>p> must not be B<NULL>.
36 DH_security_bits() returns the number of security bits of the given B<dh>
42 B<dh> doesn't hold any key parameters.
45 B<dh> doesn't hold any key parameters.
48 B<dh> doesn't hold any key parameters.
H A DDH_generate_key.pod10 #include <openssl/dh.h>
16 int DH_generate_key(DH *dh);
18 int DH_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh);
20 int DH_compute_key_padded(unsigned char *key, const BIGNUM *pub_key, DH *dh);
33 DH_generate_key() expects B<dh> to contain the shared parameters
34 B<dh-E<gt>p> and B<dh-E<gt>g>. It generates a random private DH value
35 unless B<dh-E<gt>priv_key> is already set, and computes the
36 corresponding public value B<dh-E<gt>pub_key>, which can then be
40 in B<dh> and the other party's public value in B<pub_key> and stores
41 it in B<key>. B<key> must point to B<DH_size(dh)> bytes of memory.
[all …]
H A DDH_get0_pqg.pod13 #include <openssl/dh.h>
19 void DH_get0_pqg(const DH *dh,
22 void DH_get0_key(const DH *dh,
25 const BIGNUM *DH_get0_p(const DH *dh);
26 const BIGNUM *DH_get0_q(const DH *dh);
27 const BIGNUM *DH_get0_g(const DH *dh);
30 void DH_clear_flags(DH *dh, int flags);
31 int DH_test_flags(const DH *dh, int flags);
32 void DH_set_flags(DH *dh, int flags);
34 long DH_get_length(const DH *dh);
[all …]
/openssl/providers/implementations/encode_decode/
H A Dencode_key2any.c1307 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, type_specific_params, der);
1326 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, type_specific_params, pem);
1360 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, EncryptedPrivateKeyInfo, der);
1361 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, EncryptedPrivateKeyInfo, pem);
1362 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, PrivateKeyInfo, der);
1363 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, PrivateKeyInfo, pem);
1364 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, SubjectPublicKeyInfo, der);
1365 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, SubjectPublicKeyInfo, pem);
1433 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, DH, der);
1434 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, DH, pem);
[all …]
/openssl/ssl/
H A Dtls_depr.c153 EVP_PKEY *ssl_dh_to_pkey(DH *dh) in ssl_dh_to_pkey() argument
158 if (dh == NULL) in ssl_dh_to_pkey()
161 if (EVP_PKEY_set1_DH(ret, dh) <= 0) { in ssl_dh_to_pkey()
199 DH *(*dh) (SSL *ssl, int is_export, in SSL_CTX_set_tmp_dh_callback()
202 SSL_CTX_callback_ctrl(ctx, SSL_CTRL_SET_TMP_DH_CB, (void (*)(void))dh); in SSL_CTX_set_tmp_dh_callback()
205 void SSL_set_tmp_dh_callback(SSL *ssl, DH *(*dh) (SSL *ssl, int is_export, in SSL_set_tmp_dh_callback()
208 SSL_callback_ctrl(ssl, SSL_CTRL_SET_TMP_DH_CB, (void (*)(void))dh); in SSL_set_tmp_dh_callback()
/openssl/providers/implementations/exchange/
H A Ddh_exch.c64 DH *dh; member
105 DH_free(pdhctx->dh); in dh_init()
106 pdhctx->dh = vdh; in dh_init()
134 || !dh_match_params(vdh, pdhctx->dh) in dh_set_peer()
151 if (pdhctx->dh == NULL || pdhctx->dhpeer == NULL) { in dh_plain_derive()
156 dhsize = (size_t)DH_size(pdhctx->dh); in dh_plain_derive()
170 ret = DH_compute_key(secret, pub_key, pdhctx->dh); in dh_plain_derive()
247 DH_free(pdhctx->dh); in dh_freectx()
268 dstctx->dh = NULL; in dh_dupctx()
274 if (srcctx->dh != NULL && !DH_up_ref(srcctx->dh)) in dh_dupctx()
[all …]
/openssl/providers/common/
H A Dsecuritycheck.c194 int ossl_dh_check_key(OSSL_LIB_CTX *ctx, const DH *dh) in ossl_dh_check_key() argument
201 if (dh == NULL) in ossl_dh_check_key()
204 p = DH_get0_p(dh); in ossl_dh_check_key()
205 q = DH_get0_q(dh); in ossl_dh_check_key()
214 if (DH_get_nid(dh)) in ossl_dh_check_key()
/openssl/providers/
H A Dencoders.inc21 #define ENCODER_STRUCTURE_DH "dh"
52 ENCODER_TEXT("DH", dh, yes),
98 ENCODER_w_structure("DH", dh, yes, der, type_specific_params),
99 ENCODER_w_structure("DH", dh, yes, pem, type_specific_params),
154 ENCODER_w_structure("DH", dh, yes, der, PrivateKeyInfo),
155 ENCODER_w_structure("DH", dh, yes, pem, PrivateKeyInfo),
156 ENCODER_w_structure("DH", dh, yes, der, SubjectPublicKeyInfo),
234 ENCODER_w_structure("DH", dh, yes, der, DH),
235 ENCODER_w_structure("DH", dh, yes, pem, DH),
261 ENCODER_w_structure("DH", dh, yes, der, PKCS3),
[all …]

Completed in 66 milliseconds

123