Home
last modified time | relevance | path

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

123

/openssl/crypto/dh/
H A Ddh_key.c79 dh->lock, dh->params.p, ctx); in ossl_dh_compute_key()
86 if (!dh->meth->bn_mod_exp(dh, z, pub_key, dh->priv_key, dh->params.p, ctx, in ossl_dh_compute_key()
123 ret = dh->meth->compute_key(key, pub_key, dh); in DH_compute_key()
152 rv = dh->meth->compute_key(key, pub_key, dh); in DH_compute_key_padded()
203 dh->dirty_cnt++; in dh_init()
225 return dh->meth->generate_key(dh); in DH_generate_key()
256 if (!dh->meth->bn_mod_exp(dh, pub_key, dh->params.g, prk, dh->params.p, in ossl_dh_generate_public_key()
318 || dh->length > BN_num_bits(dh->params.q)) in generate_key()
332 && dh->length >= BN_num_bits(dh->params.p)) in generate_key()
334 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()
243 dh->dirty_cnt++; in DH_set0_pqg()
249 return dh->length; in DH_get_length()
255 dh->dirty_cnt++; in DH_set_length()
278 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
175 if (BN_ucmp(dh->params.p, dh->params.q) > 0) in DH_check()
184 else if (BN_cmp(dh->params.g, dh->params.p) >= 0) in DH_check()
188 if (!BN_mod_exp(t1, dh->params.g, dh->params.q, dh->params.p, ctx)) in DH_check()
199 if (!BN_div(t1, t2, dh->params.p, dh->params.q, ctx)) in DH_check()
259 if (dh->params.q != NULL && BN_ucmp(dh->params.p, dh->params.q) < 0) { in DH_check_pub_key()
313 if (DH_get_nid((DH *)dh) != NID_undef && dh->length != 0) { in ossl_dh_check_priv_key()
338 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.c65 if (dh == NULL) in ossl_dh_key_fromdata()
93 long l = DH_get_length(dh); in ossl_dh_params_todata()
108 if (dh == NULL) in ossl_dh_key_todata()
126 if (dh->engine != NULL || ossl_dh_get_method(dh) != DH_OpenSSL()) in ossl_dh_is_foreign()
155 dupkey->flags = dh->flags; in ossl_dh_dup()
192 DH *dh = NULL; in ossl_dh_key_from_pkcs8() local
217 if (dh == NULL) in ossl_dh_key_from_pkcs8()
230 if (!DH_generate_key(dh)) in ossl_dh_key_from_pkcs8()
238 DH_free(dh); in ossl_dh_key_from_pkcs8()
239 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.c323 DH *dh = NULL; in pkey_dh_paramgen() local
354 if (dh == NULL) in pkey_dh_paramgen()
359 dh = DH_new(); in pkey_dh_paramgen()
360 if (dh == NULL) { in pkey_dh_paramgen()
368 EVP_PKEY_assign_DH(pkey, dh); in pkey_dh_paramgen()
370 DH_free(dh); in pkey_dh_paramgen()
377 DH *dh = NULL; in pkey_dh_keygen() local
386 dh = DH_new(); in pkey_dh_keygen()
387 if (dh == NULL) in pkey_dh_keygen()
400 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.c101 DH *dh = NULL; in dh_newdata() local
110 return dh; in dh_newdata()
115 DH *dh = NULL; in dhx_newdata() local
118 if (dh != NULL) { in dhx_newdata()
122 return dh; in dhx_newdata()
145 ok = ok && (DH_get0_p(dh) != NULL && DH_get0_g(dh) != NULL); in dh_has()
317 DH *dh = key; in dh_get_params() local
370 DH *dh = key; in dh_set_params() local
700 DH *dh = NULL; in dh_gen() local
803 dh = NULL; in dh_gen()
[all …]
/openssl/include/openssl/
H A Ddh.h211 OSSL_DEPRECATEDIN_3_0 void DH_free(DH *dh);
212 OSSL_DEPRECATEDIN_3_0 int DH_up_ref(DH *dh);
213 OSSL_DEPRECATEDIN_3_0 int DH_bits(const DH *dh);
214 OSSL_DEPRECATEDIN_3_0 int DH_size(const DH *dh);
215 OSSL_DEPRECATEDIN_3_0 int DH_security_bits(const DH *dh);
227 OSSL_DEPRECATEDIN_3_0 int DH_check_params_ex(const DH *dh);
228 OSSL_DEPRECATEDIN_3_0 int DH_check_ex(const DH *dh);
234 OSSL_DEPRECATEDIN_3_0 int DH_generate_key(DH *dh);
255 OSSL_DEPRECATEDIN_3_0 int DH_get_nid(const DH *dh);
277 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 (!TEST_true(DH_check(dh, &i))) in dh_test()
92 DH_get0_pqg(dh, &p2, &q2, &g2); in dh_test()
252 DH_free(dh); in dh_test()
265 DH *dh = NULL; in dh_computekey_range_test() local
272 || !TEST_ptr(dh = DH_new()) in dh_computekey_range_test()
316 DH_free(dh); in dh_computekey_range_test()
734 DH *dh = NULL; in dh_test_prime_groups() local
739 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()
534 DH_free(dh); in ffc_public_validate_test()
544 DH *dh = NULL; in ffc_private_validate_test() local
551 params = ossl_dh_get0_params(dh); in ffc_private_validate_test()
601 DH_free(dh); in ffc_private_validate_test()
611 DH *dh = NULL; in ffc_private_gen_test() local
622 params = ossl_dh_get0_params(dh); in ffc_private_gen_test()
657 DH_free(dh); in ffc_private_gen_test()
666 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.c1316 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, type_specific_params, der);
1335 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, type_specific_params, pem);
1369 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, EncryptedPrivateKeyInfo, der);
1370 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, EncryptedPrivateKeyInfo, pem);
1371 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, PrivateKeyInfo, der);
1372 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, PrivateKeyInfo, pem);
1373 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, SubjectPublicKeyInfo, der);
1374 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, SubjectPublicKeyInfo, pem);
1444 MAKE_ENCODER(dh, dh, EVP_PKEY_DH, DH, der);
1445 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
101 int key_approved = ossl_dh_check_key(ctx->dh); in dh_check_key()
131 DH_free(pdhctx->dh); in dh_init()
132 pdhctx->dh = vdh; in dh_init()
167 || !dh_match_params(vdh, pdhctx->dh) in dh_set_peer()
184 if (pdhctx->dh == NULL || pdhctx->dhpeer == NULL) { in dh_plain_derive()
189 dhsize = (size_t)DH_size(pdhctx->dh); in dh_plain_derive()
278 DH_free(pdhctx->dh); in dh_freectx()
299 dstctx->dh = NULL; in dh_dupctx()
305 if (srcctx->dh != NULL && !DH_up_ref(srcctx->dh)) in dh_dupctx()
[all …]
/openssl/providers/common/
H A Dsecuritycheck.c195 int ossl_dh_check_key(const DH *dh) in ossl_dh_check_key() argument
200 if (dh == NULL) in ossl_dh_check_key()
203 p = DH_get0_p(dh); in ossl_dh_check_key()
204 q = DH_get0_q(dh); in ossl_dh_check_key()
213 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),
100 ENCODER_w_structure("DH", dh, yes, der, type_specific_params),
101 ENCODER_w_structure("DH", dh, yes, pem, type_specific_params),
156 ENCODER_w_structure("DH", dh, yes, der, PrivateKeyInfo),
157 ENCODER_w_structure("DH", dh, yes, pem, PrivateKeyInfo),
158 ENCODER_w_structure("DH", dh, yes, der, SubjectPublicKeyInfo),
238 ENCODER_w_structure("DH", dh, yes, der, DH),
239 ENCODER_w_structure("DH", dh, yes, pem, DH),
265 ENCODER_w_structure("DH", dh, yes, der, PKCS3),
[all …]

Completed in 56 milliseconds

123