| /freebsd-13-stable/contrib/bearssl/src/rsa/ |
| HD | rsa_pss_sig_unpad.c | 34 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() 96 for (u = 0; u < (xlen - hash_len - salt_len - 2); u ++) { 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() [all …]
|
| HD | rsa_pss_sig_pad.c | 34 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()
|
| HD | rsa_pkcs1_sig_pad.c | 30 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()
|
| HD | rsa_pkcs1_sig_unpad.c | 30 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()
|
| HD | rsa_i31_pkcs1_sign.c | 30 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()
|
| HD | rsa_i32_pkcs1_sign.c | 30 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()
|
| HD | rsa_i15_pkcs1_sign.c | 30 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()
|
| HD | rsa_i62_pkcs1_sign.c | 32 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()
|
| HD | rsa_i31_pkcs1_vrfy.c | 30 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()
|
| HD | rsa_i15_pkcs1_vrfy.c | 30 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()
|
| HD | rsa_i32_pkcs1_vrfy.c | 30 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-13-stable/contrib/wpa/src/common/ |
| HD | dpp_crypto.c | 103 if (curve->hash_len == 32) in dpp_hash_vector() 105 if (curve->hash_len == 48) in dpp_hash_vector() 107 if (curve->hash_len == 64) in dpp_hash_vector() 113 int dpp_hkdf_expand(size_t hash_len, const u8 *secret, size_t secret_len, in dpp_hkdf_expand() argument 116 if (hash_len == 32) in dpp_hkdf_expand() 120 if (hash_len == 48) in dpp_hkdf_expand() 124 if (hash_len == 64) in dpp_hkdf_expand() 132 int dpp_hmac_vector(size_t hash_len, const u8 *key, size_t key_len, in dpp_hmac_vector() argument 136 if (hash_len == 32) in dpp_hmac_vector() 139 if (hash_len == 48) in dpp_hmac_vector() [all …]
|
| HD | sae.c | 535 static int hkdf_extract(size_t hash_len, const u8 *salt, size_t salt_len, in hkdf_extract() argument 539 if (hash_len == 32) in hkdf_extract() 543 if (hash_len == 48) in hkdf_extract() 548 if (hash_len == 64) in hkdf_extract() 556 static int hkdf_expand(size_t hash_len, const u8 *prk, size_t prk_len, in hkdf_expand() argument 561 if (hash_len == 32) in hkdf_expand() 566 if (hash_len == 48) in hkdf_expand() 572 if (hash_len == 64) in hkdf_expand() 824 static int sae_pwd_seed(size_t hash_len, const u8 *ssid, size_t ssid_len, in sae_pwd_seed() argument 846 if (hkdf_extract(hash_len, ssid, ssid_len, num_elem, addr, len, in sae_pwd_seed() [all …]
|
| HD | sae_pk.c | 529 int sae_hash(size_t hash_len, const u8 *data, size_t len, u8 *hash) in sae_hash() argument 531 if (hash_len == 32) in sae_hash() 534 if (hash_len == 48) in sae_hash() 538 if (hash_len == 64) in sae_hash() 545 static int sae_pk_hash_sig_data(struct sae_data *sae, size_t hash_len, in sae_pk_hash_sig_data() argument 587 if (sae_hash(hash_len, wpabuf_head(sig_data), wpabuf_len(sig_data), in sae_pk_hash_sig_data() 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() 644 if (sae_pk_hash_sig_data(sae, hash_len, true, wpabuf_head(pk->m), in sae_write_confirm_pk() [all …]
|
| HD | dpp_backup.c | 215 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() 250 asn1_put_integer(params, hash_len); /* keyLength */ in dpp_build_pbkdf2_alg_id() 264 dpp_build_pw_recipient_info(struct dpp_authentication *auth, size_t hash_len, in dpp_build_pw_recipient_info() argument 279 key_len = auth->curve->hash_len; in dpp_build_pw_recipient_info() 287 if (dpp_pbkdf2(hash_len, key, key_len, wpabuf_head(salt), 64, 1000, in dpp_build_pw_recipient_info() 288 kek, hash_len)) { in dpp_build_pw_recipient_info() 293 kek, hash_len); in dpp_build_pw_recipient_info() [all …]
|
| HD | dpp_pkex.c | 558 curve->hash_len); in dpp_pkex_rx_exchange_req() 598 clear_len = 4 + 2 * curve->prime_len + 4 + curve->hash_len; in dpp_pkex_build_commit_reveal_req() 638 wpabuf_put_le16(clear, curve->hash_len); in dpp_pkex_build_commit_reveal_req() 639 wpabuf_put_data(clear, u, curve->hash_len - 1); in dpp_pkex_build_commit_reveal_req() 640 wpabuf_put_u8(clear, u[curve->hash_len - 1] ^ 0x01); in dpp_pkex_build_commit_reveal_req() 647 wpabuf_put_le16(clear, curve->hash_len); in dpp_pkex_build_commit_reveal_req() 648 wpabuf_put_data(clear, u, curve->hash_len); in dpp_pkex_build_commit_reveal_req() 671 if (aes_siv_encrypt(pkex->z, curve->hash_len, in dpp_pkex_build_commit_reveal_req() 860 if (dpp_hmac_vector(curve->hash_len, Jx, Jx_len, num_elem, addr, len, u) in dpp_pkex_rx_exchange_resp() 863 wpa_hexdump(MSG_DEBUG, "DPP: u", u, curve->hash_len); in dpp_pkex_rx_exchange_resp() [all …]
|
| HD | dpp_i.h | 92 int dpp_hkdf_expand(size_t hash_len, const u8 *secret, size_t secret_len, 94 int dpp_hmac_vector(size_t hash_len, const u8 *key, size_t key_len, 100 int dpp_pbkdf2(size_t hash_len, const u8 *password, size_t password_len, 109 int dpp_derive_k1(const u8 *Mx, size_t Mx_len, u8 *k1, unsigned int hash_len); 110 int dpp_derive_k2(const u8 *Nx, size_t Nx_len, u8 *k2, unsigned int hash_len); 116 int dpp_derive_pmk(const u8 *Nx, size_t Nx_len, u8 *pmk, unsigned int hash_len); 134 u8 *z, unsigned int hash_len);
|
| HD | dpp_auth.c | 205 if (aes_siv_encrypt(auth->k1, auth->curve->hash_len, clear, siv_len, in dpp_auth_build_req() 391 if (aes_siv_encrypt(siv_key, auth->curve->hash_len, clear, siv_len, in dpp_auth_build_resp() 492 auth->curve->hash_len) < 0) in dpp_auth_build_resp_ok() 506 WPA_PUT_LE16(&r_auth[2], auth->curve->hash_len); in dpp_auth_build_resp_ok() 512 r_auth[4 + auth->curve->hash_len / 2] ^= 0x01; in dpp_auth_build_resp_ok() 515 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_auth_build_resp_ok() 516 r_auth, 4 + auth->curve->hash_len, in dpp_auth_build_resp_ok() 519 wrapped_r_auth_len = 4 + auth->curve->hash_len + AES_BLOCK_SIZE; in dpp_auth_build_resp_ok() 791 auth->curve->hash_len) < 0) in dpp_auth_req_rx() 806 if (aes_siv_decrypt(auth->k1, auth->curve->hash_len, in dpp_auth_req_rx() [all …]
|
| /freebsd-13-stable/contrib/wpa/hostapd/ |
| HD | sae_pk_gen.c | 33 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-13-stable/contrib/libarchive/libarchive/ |
| HD | archive_hmac.c | 91 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-13-stable/contrib/bearssl/inc/ |
| HD | bearssl_rsa.h | 280 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,
|
| HD | bearssl_ec.h | 711 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-13-stable/contrib/wpa/src/eap_common/ |
| HD | ikev2_common.c | 118 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() 402 sign_len = wpabuf_len(sign_msg) + nonce_len + prf->hash_len; in ikev2_derive_auth_data() 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() 483 if (os_memcmp_const(integ, hash, integ_alg->hash_len) != 0) { in ikev2_decrypt_payload() [all …]
|
| /freebsd-13-stable/contrib/wpa/src/tls/ |
| HD | tlsv1_client_ocsp.c | 124 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-13-stable/contrib/bearssl/src/ec/ |
| HD | ecdsa_i15_vrfy_asn1.c | 32 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()
|