Home
last modified time | relevance | path

Searched refs:hash_len (Results 1 – 25 of 76) sorted by relevance

1234

/freebsd/contrib/bearssl/src/rsa/
H A Drsa_pss_sig_unpad.c34 size_t u, xlen, hash_len; in br_rsa_pss_sig_unpad() local
40 hash_len = br_digest_size(hf_data); in br_rsa_pss_sig_unpad()
72 if (hash_len > xlen || salt_len > xlen in br_rsa_pss_sig_unpad()
73 || (hash_len + salt_len + 2) > xlen) in br_rsa_pss_sig_unpad()
87 seed = x + xlen - hash_len - 1; in br_rsa_pss_sig_unpad()
88 br_mgf1_xor(x, xlen - hash_len - 1, hf_mgf1, seed, hash_len); in br_rsa_pss_sig_unpad()
99 r |= x[xlen - hash_len - salt_len - 2] ^ 0x01; in br_rsa_pss_sig_unpad()
104 salt = x + xlen - hash_len - salt_len - 1; in br_rsa_pss_sig_unpad()
108 hf_data->update(&hc.vtable, hash, hash_len); in br_rsa_pss_sig_unpad()
116 for (u = 0; u < hash_len; u ++) { in br_rsa_pss_sig_unpad()
[all …]
H A Drsa_pss_sig_pad.c34 size_t xlen, hash_len; in br_rsa_pss_sig_pad() local
38 hash_len = br_digest_size(hf_data); in br_rsa_pss_sig_pad()
56 if (hash_len > xlen || salt_len > xlen in br_rsa_pss_sig_pad()
57 || (hash_len + salt_len + 2) > xlen) in br_rsa_pss_sig_pad()
65 salt = x + xlen - hash_len - salt_len - 1; in br_rsa_pss_sig_pad()
73 seed = x + xlen - hash_len - 1; in br_rsa_pss_sig_pad()
77 hf_data->update(&hc.vtable, hash, hash_len); in br_rsa_pss_sig_pad()
85 memset(x, 0, xlen - salt_len - hash_len - 2); in br_rsa_pss_sig_pad()
86 x[xlen - salt_len - hash_len - 2] = 0x01; in br_rsa_pss_sig_pad()
91 br_mgf1_xor(x, xlen - hash_len - 1, hf_mgf1, seed, hash_len); in br_rsa_pss_sig_pad()
H A Drsa_pkcs1_sig_pad.c30 const unsigned char *hash, size_t hash_len, in br_rsa_pkcs1_sig_pad() argument
63 if (xlen < hash_len + 11) { in br_rsa_pkcs1_sig_pad()
68 u = xlen - hash_len; in br_rsa_pkcs1_sig_pad()
78 if (xlen < (x3 + hash_len + 21)) { in br_rsa_pkcs1_sig_pad()
83 u = xlen - x3 - hash_len - 11; in br_rsa_pkcs1_sig_pad()
87 x[u + 2] = x3 + hash_len + 8; in br_rsa_pkcs1_sig_pad()
96 x[u ++] = hash_len; in br_rsa_pkcs1_sig_pad()
98 memcpy(x + u, hash, hash_len); in br_rsa_pkcs1_sig_pad()
H A Drsa_pkcs1_sig_unpad.c30 const unsigned char *hash_oid, size_t hash_len, in br_rsa_pkcs1_sig_unpad() argument
90 if (sig_len - u != hash_len + 1 || sig[u] != 0x00) { in br_rsa_pkcs1_sig_unpad()
97 zlen = sig_len - u - hash_len; in br_rsa_pkcs1_sig_unpad()
108 pad2[2] = x2 + hash_len + 4; in br_rsa_pkcs1_sig_unpad()
114 pad2[pad_len - 1] = hash_len; in br_rsa_pkcs1_sig_unpad()
119 memcpy(hash_out, sig + sig_len - hash_len, hash_len); in br_rsa_pkcs1_sig_unpad()
H A Drsa_i15_pkcs1_sign.c30 const unsigned char *hash, size_t hash_len, in br_rsa_i15_pkcs1_sign() argument
33 if (!br_rsa_pkcs1_sig_pad(hash_oid, hash, hash_len, sk->n_bitlen, x)) { in br_rsa_i15_pkcs1_sign()
H A Drsa_i31_pkcs1_sign.c30 const unsigned char *hash, size_t hash_len, in br_rsa_i31_pkcs1_sign() argument
33 if (!br_rsa_pkcs1_sig_pad(hash_oid, hash, hash_len, sk->n_bitlen, x)) { in br_rsa_i31_pkcs1_sign()
H A Drsa_i32_pkcs1_sign.c30 const unsigned char *hash, size_t hash_len, in br_rsa_i32_pkcs1_sign() argument
33 if (!br_rsa_pkcs1_sig_pad(hash_oid, hash, hash_len, sk->n_bitlen, x)) { in br_rsa_i32_pkcs1_sign()
H A Drsa_i62_pkcs1_sign.c32 const unsigned char *hash, size_t hash_len, in br_rsa_i62_pkcs1_sign() argument
35 if (!br_rsa_pkcs1_sig_pad(hash_oid, hash, hash_len, sk->n_bitlen, x)) { in br_rsa_i62_pkcs1_sign()
H A Drsa_i15_pkcs1_vrfy.c30 const unsigned char *hash_oid, size_t hash_len, in br_rsa_i15_pkcs1_vrfy() argument
42 return br_rsa_pkcs1_sig_unpad(sig, xlen, hash_oid, hash_len, hash_out); in br_rsa_i15_pkcs1_vrfy()
H A Drsa_i31_pkcs1_vrfy.c30 const unsigned char *hash_oid, size_t hash_len, in br_rsa_i31_pkcs1_vrfy() argument
42 return br_rsa_pkcs1_sig_unpad(sig, xlen, hash_oid, hash_len, hash_out); in br_rsa_i31_pkcs1_vrfy()
H A Drsa_i32_pkcs1_vrfy.c30 const unsigned char *hash_oid, size_t hash_len, in br_rsa_i32_pkcs1_vrfy() argument
42 return br_rsa_pkcs1_sig_unpad(sig, xlen, hash_oid, hash_len, hash_out); in br_rsa_i32_pkcs1_vrfy()
/freebsd/contrib/wpa/src/common/
H A Ddpp_crypto.c220 plen = left > hash_len ? hash_len : left; in dpp_pbkdf2()
378 if (dpp_hmac(hash_len, salt, hash_len, Mx, Mx_len, prk) < 0) in dpp_derive_k1()
384 res = dpp_hkdf_expand(hash_len, prk, hash_len, info, k1, hash_len); in dpp_derive_k1()
405 res = dpp_hmac(hash_len, salt, hash_len, Nx, Nx_len, prk); in dpp_derive_k2()
412 res = dpp_hkdf_expand(hash_len, prk, hash_len, info, k2, hash_len); in dpp_derive_k2()
425 unsigned int hash_len = auth->curve->hash_len; in dpp_derive_bk_ke() local
1134 res = dpp_hkdf_expand(hash_len, prk, hash_len, info, pmk, hash_len); in dpp_derive_pmk()
2058 unsigned int hash_len = auth->curve->hash_len; in dpp_build_csr() local
2085 if (dpp_hkdf_expand(hash_len, auth->bk, hash_len, in dpp_build_csr()
2133 unsigned int hash_len = auth->curve->hash_len; in dpp_validate_csr() local
[all …]
H A Dsae.c537 if (hash_len == 32) in hkdf_extract()
541 if (hash_len == 48) in hkdf_extract()
890 if (hkdf_expand(hash_len, pwd_seed, hash_len, in sae_derive_pt_ecc()
912 if (hkdf_expand(hash_len, pwd_seed, hash_len, in sae_derive_pt_ecc()
994 if (hkdf_expand(hash_len, pwd_seed, hash_len, in sae_derive_pt_ffc()
1145 size_t hash_len; in sae_derive_pwe_from_pt_ecc() local
1165 if (hkdf_extract(hash_len, salt, hash_len, 2, addr, len, hash) < 0) in sae_derive_pwe_from_pt_ecc()
1209 size_t hash_len; in sae_derive_pwe_from_pt_ffc() local
1628 hash_len); in sae_derive_keys()
2250 size_t hash_len; in sae_write_confirm() local
[all …]
H A Dsae_pk.c531 if (hash_len == 32) in sae_hash()
534 if (hash_len == 48) in sae_hash()
538 if (hash_len == 64) in sae_hash()
591 hash, hash_len); in sae_pk_hash_sig_data()
609 size_t hash_len; in sae_write_confirm_pk() local
643 hash_len = sae_group_2_hash_len(pk->group); in sae_write_confirm_pk()
709 size_t hash_len, hash_data_len; in sae_pk_valid_fingerprint() local
722 hash_len = sae_group_2_hash_len(group); in sae_pk_valid_fingerprint()
741 hash, hash_len); in sae_pk_valid_fingerprint()
780 size_t hash_len; in sae_check_confirm_pk() local
[all …]
H A Ddpp_backup.c215 size_t hash_len) in dpp_build_pbkdf2_alg_id() argument
234 if (hash_len == 32) in dpp_build_pbkdf2_alg_id()
236 else if (hash_len == 48) in dpp_build_pbkdf2_alg_id()
238 else if (hash_len == 64) in dpp_build_pbkdf2_alg_id()
288 kek, hash_len)) { in dpp_build_pw_recipient_info()
293 kek, hash_len); in dpp_build_pw_recipient_info()
385 if (hash_len == 32) in dpp_build_enc_cont_info()
387 else if (hash_len == 48) in dpp_build_enc_cont_info()
389 else if (hash_len == 64) in dpp_build_enc_cont_info()
455 size_t hash_len; in dpp_build_enveloped_data() local
[all …]
H A Ddpp_pkex.c552 Kx, Kx_len, pkex->z, curve->hash_len); in dpp_pkex_rx_exchange_req()
631 wpabuf_put_le16(clear, curve->hash_len); in dpp_pkex_build_commit_reveal_req()
640 wpabuf_put_le16(clear, curve->hash_len); in dpp_pkex_build_commit_reveal_req()
641 wpabuf_put_data(clear, u, curve->hash_len); in dpp_pkex_build_commit_reveal_req()
664 if (aes_siv_encrypt(pkex->z, curve->hash_len, in dpp_pkex_build_commit_reveal_req()
870 pkex->z, curve->hash_len); in dpp_pkex_rx_exchange_resp()
950 wpabuf_put_le16(clear, curve->hash_len); in dpp_pkex_build_commit_reveal_resp()
959 wpabuf_put_le16(clear, curve->hash_len); in dpp_pkex_build_commit_reveal_resp()
960 wpabuf_put_data(clear, v, curve->hash_len); in dpp_pkex_build_commit_reveal_resp()
1135 u, curve->hash_len); in dpp_pkex_rx_commit_reveal_req()
[all …]
H A Ddpp_i.h82 int dpp_hkdf_expand(size_t hash_len, const u8 *secret, size_t secret_len,
84 int dpp_hmac_vector(size_t hash_len, const u8 *key, size_t key_len,
90 int dpp_pbkdf2(size_t hash_len, const u8 *password, size_t password_len,
101 int dpp_derive_k1(const u8 *Mx, size_t Mx_len, u8 *k1, unsigned int hash_len);
102 int dpp_derive_k2(const u8 *Nx, size_t Nx_len, u8 *k2, unsigned int hash_len);
108 int dpp_derive_pmk(const u8 *Nx, size_t Nx_len, u8 *pmk, unsigned int hash_len);
126 u8 *z, unsigned int hash_len);
/freebsd/contrib/wpa/hostapd/
H A Dsae_pk_gen.c33 size_t hash_len; in main() local
81 hash_len = 32; in main()
84 hash_len = 48; in main()
87 hash_len = 64; in main()
110 if (sae_hash(hash_len, data, data_len, hash) < 0) { in main()
129 wpa_snprintf_hex(hash_hex, sizeof(hash_hex), hash, hash_len) < 0) in main()
149 for (j = 0; j < 8 * (int) hash_len / 20; j++) { in main()
152 sae_pk_buf_shift_left_19(hash + sec, hash_len - sec); in main()
166 pw_base_bin, hash_len - sec) >= 0) in main()
177 for (j = 4; j <= ((int) hash_len * 8 + 5 - 8 * sec) / 19; j++) { in main()
/freebsd/contrib/libarchive/libarchive/
H A Darchive_hmac.c91 DWORD hash_len; in __hmac_sha1_init() local
101 status = BCryptGetProperty(hAlg, BCRYPT_HASH_LENGTH, (PUCHAR)&hash_len, in __hmac_sha1_init()
102 sizeof(hash_len), &result, 0); in __hmac_sha1_init()
107 hash = (PBYTE)HeapAlloc(GetProcessHeap(), 0, hash_len); in __hmac_sha1_init()
122 ctx->hash_len = hash_len; in __hmac_sha1_init()
138 BCryptFinishHash(ctx->hHash, ctx->hash, ctx->hash_len, 0); in __hmac_sha1_final()
139 if (ctx->hash_len == *out_len) in __hmac_sha1_final()
/freebsd/contrib/bearssl/inc/
H A Dbearssl_rsa.h280 const unsigned char *hash_oid, size_t hash_len,
435 const unsigned char *hash, size_t hash_len,
589 const unsigned char *hash_oid, size_t hash_len,
635 const unsigned char *hash, size_t hash_len,
690 const unsigned char *hash_oid, size_t hash_len,
736 const unsigned char *hash, size_t hash_len,
799 const unsigned char *hash_oid, size_t hash_len,
857 const unsigned char *hash, size_t hash_len,
980 const unsigned char *hash_oid, size_t hash_len,
1026 const unsigned char *hash, size_t hash_len,
H A Dbearssl_ec.h711 const void *hash, size_t hash_len,
760 const void *hash, size_t hash_len,
777 const void *hash, size_t hash_len,
826 const void *hash, size_t hash_len,
843 const void *hash, size_t hash_len,
/freebsd/contrib/wpa/src/eap_common/
H A Dikev2_common.c118 size_t hash_len; in ikev2_prf_plus() local
128 hash_len = prf->hash_len; in ikev2_prf_plus()
131 len[0] = hash_len; in ikev2_prf_plus()
150 clen = hash_len; in ikev2_prf_plus()
411 os_memcpy(pos, hash, prf->hash_len); in ikev2_derive_auth_data()
416 ikev2_prf_hash(prf->id, hash, prf->hash_len, 1, in ikev2_derive_auth_data()
461 if (encrypted_len < iv_len + 1 + integ_alg->hash_len) { in ikev2_decrypt_payload()
470 integ = end - integ_alg->hash_len; in ikev2_decrypt_payload()
594 icv = wpabuf_put(msg, integ_alg->hash_len); in ikev2_build_encrypted()
602 wpabuf_len(msg) - integ_alg->hash_len, icv); in ikev2_build_encrypted()
[all …]
/freebsd/contrib/wpa/src/tls/
H A Dtlsv1_client_ocsp.c124 unsigned int hash_len; in tls_process_ocsp_single_response() local
175 hash_len = ocsp_hash_data(&alg.oid, issuer->subject_dn, in tls_process_ocsp_single_response()
177 if (hash_len == 0 || name_hash_len != hash_len || in tls_process_ocsp_single_response()
178 os_memcmp(name_hash, hash, hash_len) != 0) { in tls_process_ocsp_single_response()
181 hash, hash_len); in tls_process_ocsp_single_response()
197 hash_len = ocsp_hash_data(&alg.oid, issuer->public_key, in tls_process_ocsp_single_response()
199 if (hash_len == 0 || key_hash_len != hash_len || in tls_process_ocsp_single_response()
200 os_memcmp(key_hash, hash, hash_len) != 0) { in tls_process_ocsp_single_response()
203 hash, hash_len); in tls_process_ocsp_single_response()
/freebsd/contrib/bearssl/src/ec/
H A Decdsa_i15_vrfy_asn1.c32 const void *hash, size_t hash_len, in br_ecdsa_i15_vrfy_asn1() argument
47 return br_ecdsa_i15_vrfy_raw(impl, hash, hash_len, pk, rsig, sig_len); in br_ecdsa_i15_vrfy_asn1()
H A Decdsa_i31_vrfy_asn1.c32 const void *hash, size_t hash_len, in br_ecdsa_i31_vrfy_asn1() argument
47 return br_ecdsa_i31_vrfy_raw(impl, hash, hash_len, pk, rsig, sig_len); in br_ecdsa_i31_vrfy_asn1()

1234