| /freebsd/sys/ufs/ufs/ |
| H A D | ufs_dirhash.c | 94 static int ufsdirhash_hash(struct dirhash *dh, char *name, int namelen); 95 static void ufsdirhash_adjfree(struct dirhash *dh, doff_t offset, int diff); 96 static void ufsdirhash_delslot(struct dirhash *dh, int slot); 97 static int ufsdirhash_findslot(struct dirhash *dh, char *name, int namelen, 110 #define DIRHASH_ASSERT_LOCKED(dh) \ argument 111 sx_assert(&(dh)->dh_lock, SA_LOCKED) 153 ufsdirhash_hold(struct dirhash *dh) in ufsdirhash_hold() argument 156 refcount_acquire(&dh->dh_refcount); in ufsdirhash_hold() 160 ufsdirhash_drop(struct dirhash *dh) in ufsdirhash_drop() argument 163 if (refcount_release(&dh->dh_refcount)) { in ufsdirhash_drop() [all …]
|
| /freebsd/crypto/openssl/crypto/dh/ |
| H A D | dh_key.c | 29 static int generate_key(DH *dh); 30 static int dh_bn_mod_exp(const DH *dh, BIGNUM *r, 33 static int dh_init(DH *dh); 34 static int dh_finish(DH *dh); 40 int ossl_dh_compute_key(unsigned char *key, const BIGNUM *pub_key, DH *dh) in ossl_dh_compute_key() argument 47 if (BN_num_bits(dh->params.p) > OPENSSL_DH_MAX_MODULUS_BITS) { in ossl_dh_compute_key() 52 if (dh->params.q != NULL in ossl_dh_compute_key() 53 && BN_num_bits(dh->params.q) > OPENSSL_DH_MAX_MODULUS_BITS) { in ossl_dh_compute_key() 58 if (BN_num_bits(dh->params.p) < DH_MIN_MODULUS_BITS) { in ossl_dh_compute_key() 63 ctx = BN_CTX_new_ex(dh->libctx); in ossl_dh_compute_key() [all …]
|
| H A D | dh_lib.c | 32 int DH_set_method(DH *dh, const DH_METHOD *meth) in DH_set_method() argument 39 mtmp = dh->meth; in DH_set_method() 41 mtmp->finish(dh); in DH_set_method() 43 ENGINE_finish(dh->engine); 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() 52 const DH_METHOD *ossl_dh_get_method(const DH *dh) in ossl_dh_get_method() argument 54 return dh->meth; in ossl_dh_get_method() 196 int DH_bits(const DH *dh) in DH_bits() argument [all …]
|
| H A D | dh_check.c | 29 int DH_check_params_ex(const DH *dh) in DH_check_params_ex() argument 33 if (!DH_check_params(dh, &errflags)) in DH_check_params_ex() 49 int DH_check_params(const DH *dh, int *ret) in DH_check_params() argument 58 nid = DH_get_nid((DH *)dh); in DH_check_params() 66 return ossl_ffc_params_FIPS186_4_validate(dh->libctx, &dh->params, in DH_check_params() 70 int DH_check_params(const DH *dh, int *ret) in DH_check_params() argument 77 ctx = BN_CTX_new_ex(dh->libctx); in DH_check_params() 85 if (!BN_is_odd(dh->params.p)) in DH_check_params() 87 if (BN_is_negative(dh->params.g) in DH_check_params() 88 || BN_is_zero(dh->params.g) in DH_check_params() [all …]
|
| H A D | dh_ameth.c | 37 DH *dh = NULL; in d2i_dhp() local 41 dh = d2i_DHxparams(NULL, pp, length); in d2i_dhp() 43 dh = d2i_DHparams(NULL, pp, length); in d2i_dhp() 45 return dh; in d2i_dhp() 57 DH_free(pkey->pkey.dh); in int_dh_free() 70 DH *dh = NULL; in dh_pub_decode() local 85 if ((dh = d2i_dhp(pkey, &pm, pmlen)) == NULL) { in dh_pub_decode() 96 if ((dh->pub_key = ASN1_INTEGER_to_BN(public_key, NULL)) == NULL) { in dh_pub_decode() 102 EVP_PKEY_assign(pkey, pkey->ameth->pkey_id, dh); in dh_pub_decode() 107 DH_free(dh); in dh_pub_decode() [all …]
|
| H A D | dh_group_params.c | 29 DH *dh = ossl_dh_new_ex(libctx); in dh_param_init() local 31 if (dh == NULL) in dh_param_init() 34 ossl_ffc_named_group_set(&dh->params, group); in dh_param_init() 35 dh->params.nid = ossl_ffc_named_group_get_uid(group); in dh_param_init() 36 dh->dirty_cnt++; in dh_param_init() 37 return dh; in dh_param_init() 56 void ossl_dh_cache_named_group(DH *dh) in ossl_dh_cache_named_group() argument 60 if (dh == NULL) in ossl_dh_cache_named_group() 63 dh->params.nid = NID_undef; /* flush cached value */ in ossl_dh_cache_named_group() 66 if (dh->params.p == NULL in ossl_dh_cache_named_group() [all …]
|
| H A D | dh_backend.c | 31 static int dh_ffc_params_fromdata(DH *dh, const OSSL_PARAM params[]) in dh_ffc_params_fromdata() argument 34 FFC_PARAMS *ffc = ossl_dh_get0_params(dh); in dh_ffc_params_fromdata() 38 ossl_dh_cache_named_group(dh); /* This increments dh->dirty_cnt */ in dh_ffc_params_fromdata() 42 int ossl_dh_params_fromdata(DH *dh, const OSSL_PARAM params[]) in ossl_dh_params_fromdata() argument 47 if (!dh_ffc_params_fromdata(dh, params)) in ossl_dh_params_fromdata() 53 || !DH_set_length(dh, priv_len))) in ossl_dh_params_fromdata() 59 int ossl_dh_key_fromdata(DH *dh, const OSSL_PARAM params[], int include_private) in ossl_dh_key_fromdata() argument 64 if (dh == NULL) in ossl_dh_key_fromdata() 79 if (!DH_set0_key(dh, pub_key, priv_key)) in ossl_dh_key_fromdata() 90 int ossl_dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]) in ossl_dh_params_todata() argument [all …]
|
| H A D | dh_rfc5114.c | 31 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 D | dh_asn1.c | 38 DH *dh = (DH *)*pval; in dh_cb() local 40 DH_clear_flags(dh, DH_FLAG_TYPE_MASK); in dh_cb() 41 DH_set_flags(dh, DH_FLAG_TYPE_DH); in dh_cb() 42 ossl_dh_cache_named_group(dh); in dh_cb() 43 dh->dirty_cnt++; in dh_cb() 98 DH *dh = NULL; in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname() local 100 dh = DH_new(); in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname() 101 if (dh == NULL) in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname() 105 DH_free(dh); in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname() 111 *a = dh; in IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname() [all …]
|
| H A D | dh_pmeth.c | 321 DH *dh = NULL; in pkey_dh_paramgen() local 334 if ((dh = DH_new_by_nid(dctx->param_nid)) == NULL) in pkey_dh_paramgen() 336 EVP_PKEY_assign(pkey, type, dh); in pkey_dh_paramgen() 350 dh = ffc_params_generate(NULL, dctx, pcb); in pkey_dh_paramgen() 352 if (dh == NULL) in pkey_dh_paramgen() 354 EVP_PKEY_assign(pkey, EVP_PKEY_DHX, dh); in pkey_dh_paramgen() 357 dh = DH_new(); in pkey_dh_paramgen() 358 if (dh == NULL) { in pkey_dh_paramgen() 362 ret = DH_generate_parameters_ex(dh, in pkey_dh_paramgen() 366 EVP_PKEY_assign_DH(pkey, dh); in pkey_dh_paramgen() [all …]
|
| H A D | dh_gen.c | 39 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 D | dh_local.h | 46 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,
|
| /freebsd/contrib/elftoolchain/libpe/ |
| H A D | libpe_dos.c | 42 PE_DosHdr *dh; in libpe_parse_msdos_header() local 53 if ((dh = malloc(sizeof(*dh))) == NULL) { in libpe_parse_msdos_header() 57 pe->pe_dh = dh; in libpe_parse_msdos_header() 60 memcpy(dh->dh_magic, hdr, 2); in libpe_parse_msdos_header() 62 PE_READ16(hdr, dh->dh_lastsize); in libpe_parse_msdos_header() 63 PE_READ16(hdr, dh->dh_nblock); in libpe_parse_msdos_header() 64 PE_READ16(hdr, dh->dh_nreloc); in libpe_parse_msdos_header() 65 PE_READ16(hdr, dh->dh_hdrsize); in libpe_parse_msdos_header() 66 PE_READ16(hdr, dh->dh_minalloc); in libpe_parse_msdos_header() 67 PE_READ16(hdr, dh->dh_maxalloc); in libpe_parse_msdos_header() [all …]
|
| /freebsd/crypto/openssl/include/crypto/ |
| H A D | dh.h | 22 int ossl_dh_generate_ffc_parameters(DH *dh, int type, int pbits, int qbits, 24 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[]); 35 int ossl_dh_key_fromdata(DH *dh, const OSSL_PARAM params[], int include_private); 36 int ossl_dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]); 37 int ossl_dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[], [all …]
|
| /freebsd/crypto/openssl/providers/implementations/keymgmt/ |
| H A D | dh_kmgmt.c | 103 DH *dh = NULL; in dh_newdata() local 106 dh = ossl_dh_new_ex(PROV_LIBCTX_OF(provctx)); in dh_newdata() 107 if (dh != NULL) { in dh_newdata() 108 DH_clear_flags(dh, DH_FLAG_TYPE_MASK); in dh_newdata() 109 DH_set_flags(dh, DH_FLAG_TYPE_DH); in dh_newdata() 112 return dh; in dh_newdata() 117 DH *dh = NULL; in dhx_newdata() local 119 dh = ossl_dh_new_ex(PROV_LIBCTX_OF(provctx)); in dhx_newdata() 120 if (dh != NULL) { in dhx_newdata() 121 DH_clear_flags(dh, DH_FLAG_TYPE_MASK); in dhx_newdata() [all …]
|
| /freebsd/contrib/tcpdump/ |
| H A D | print-dccp.c | 76 #define DCCPH_CCVAL(dh) ((GET_U_1((dh)->dccph_ccval_cscov) >> 4) & 0xF) argument 77 #define DCCPH_CSCOV(dh) (GET_U_1((dh)->dccph_ccval_cscov) & 0xF) argument 79 #define DCCPH_X(dh) (GET_U_1((dh)->dccph_xtr) & 1) argument 80 #define DCCPH_TYPE(dh) ((GET_U_1((dh)->dccph_xtr) >> 1) & 0xF) argument 190 const struct dccp_hdr *dh, u_int len) in dccp_csum_coverage() argument 194 if (DCCPH_CSCOV(dh) == 0) in dccp_csum_coverage() 196 cov = (GET_U_1(dh->dccph_doff) + DCCPH_CSCOV(dh) - 1) * sizeof(uint32_t); in dccp_csum_coverage() 201 const struct dccp_hdr *dh, u_int len) in dccp_cksum() argument 203 return nextproto4_cksum(ndo, ip, (const uint8_t *)(const void *)dh, len, in dccp_cksum() 204 dccp_csum_coverage(ndo, dh, len), IPPROTO_DCCP); in dccp_cksum() [all …]
|
| /freebsd/crypto/openssl/include/openssl/ |
| H A D | dh.h | 207 OSSL_DEPRECATEDIN_3_0 int DH_set_method(DH *dh, const DH_METHOD *meth); 211 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); 223 OSSL_DEPRECATEDIN_3_0 int DH_generate_parameters_ex(DH *dh, int prime_len, 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); 229 OSSL_DEPRECATEDIN_3_0 int DH_check_pub_key_ex(const DH *dh, const BIGNUM *pub_key); [all …]
|
| /freebsd/contrib/wpa/src/crypto/ |
| H A D | dh_groups.c | 1193 struct wpabuf * dh_init(const struct dh_group *dh, struct wpabuf **priv) in dh_init() argument 1198 if (dh == NULL) in dh_init() 1202 *priv = wpabuf_alloc(dh->prime_len); in dh_init() 1206 pv_len = dh->prime_len; in dh_init() 1213 if (crypto_dh_init(*dh->generator, dh->prime, dh->prime_len, in dh_init() 1221 wpabuf_put(*priv, dh->prime_len); in dh_init() 1222 wpabuf_put(pv, dh->prime_len); in dh_init() 1239 const struct dh_group *dh) in dh_derive_shared() argument 1244 if (dh == NULL || peer_public == NULL || own_private == NULL) in dh_derive_shared() 1247 shared_len = dh->prime_len; in dh_derive_shared() [all …]
|
| /freebsd/crypto/openssh/ |
| H A D | kexdh.c | 52 kex->dh = dh_new_group1(); in kex_dh_keygen() 56 kex->dh = dh_new_group14(); in kex_dh_keygen() 59 kex->dh = dh_new_group16(); in kex_dh_keygen() 62 kex->dh = dh_new_group18(); in kex_dh_keygen() 67 if (kex->dh == NULL) in kex_dh_keygen() 69 return (dh_gen_key(kex->dh, kex->we_need * 8)); in kex_dh_keygen() 85 DHparams_print_fp(stderr, kex->dh); in kex_dh_compute_key() 89 if (!dh_pub_is_valid(kex->dh, dh_pub)) { in kex_dh_compute_key() 93 klen = DH_size(kex->dh); in kex_dh_compute_key() 99 if ((kout = DH_compute_key(kbuf, dh_pub, kex->dh)) < 0 || in kex_dh_compute_key() [all …]
|
| H A D | dh.c | 236 dh_pub_is_valid(const DH *dh, const BIGNUM *dh_pub) in dh_pub_is_valid() argument 244 DH_get0_pqg(dh, &dh_p, NULL, NULL); in dh_pub_is_valid() 284 dh_gen_key(DH *dh, int need) in dh_gen_key() argument 289 DH_get0_pqg(dh, &dh_p, NULL, NULL); in dh_gen_key() 301 if (!DH_set_length(dh, MINIMUM(need * 2, pbits - 1))) in dh_gen_key() 304 if (DH_generate_key(dh) == 0) in dh_gen_key() 306 DH_get0_key(dh, &pub_key, NULL); in dh_gen_key() 307 if (!dh_pub_is_valid(dh, pub_key)) in dh_gen_key() 315 DH *dh; in dh_new_group_asc() local 318 if ((dh = DH_new()) == NULL) in dh_new_group_asc() [all …]
|
| /freebsd/sys/crypto/openssl/i386/ |
| H A D | cast-586.S | 35 movb %dh,%cl 39 movb %dh,%al 56 movb %dh,%cl 60 movb %dh,%al 77 movb %dh,%cl 81 movb %dh,%al 98 movb %dh,%cl 102 movb %dh,%al 119 movb %dh,%cl 123 movb %dh,%al [all …]
|
| /freebsd/cddl/contrib/opensolaris/lib/libdtrace/common/ |
| H A D | drti.c | 106 dof_helper_t dh; in dtrace_dof_init() local 153 dh.dofhp_dof = (uintptr_t)dof; in dtrace_dof_init() 155 dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_base : 0; in dtrace_dof_init() 156 dh.dofhp_pid = getpid(); in dtrace_dof_init() 158 dh.dofhp_addr = elf->e_type == ET_DYN ? (uintptr_t) lmp->l_addr : 0; in dtrace_dof_init() 162 (void) snprintf(dh.dofhp_mod, sizeof (dh.dofhp_mod), in dtrace_dof_init() 165 (void) snprintf(dh.dofhp_mod, sizeof (dh.dofhp_mod), in dtrace_dof_init() 192 if ((gen = ioctl(fd, DTRACEHIOC_ADDDOF, &dh)) == -1) in dtrace_dof_init() 197 gen = dh.dofhp_gen; in dtrace_dof_init()
|
| /freebsd/crypto/openssl/test/ |
| H A D | dhtest.c | 39 DH *dh = NULL; in dh_test() local 57 if (!TEST_ptr(dh = DH_new()) in dh_test() 72 || !TEST_true(DH_set0_pqg(dh, p, q, g))) 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() 99 if (!TEST_ptr_eq(DH_get0_p(dh), p2) in dh_test() 100 || !TEST_ptr_eq(DH_get0_q(dh), q2) in dh_test() 101 || !TEST_ptr_eq(DH_get0_g(dh), g2)) in dh_test() 106 || !TEST_true(DH_set0_key(dh, NULL, priv_key))) in dh_test() 110 DH_get0_key(dh, &pub_key2, &priv_key2); in dh_test() [all …]
|
| /freebsd/crypto/openssl/doc/man3/ |
| H A D | DH_size.pod | 10 #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 D | DH_generate_key.pod | 10 #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 …]
|