Lines Matching refs:hash_len
100 if (curve->hash_len == 32) in dpp_hash_vector()
103 if (curve->hash_len == 48) in dpp_hash_vector()
105 if (curve->hash_len == 64) in dpp_hash_vector()
112 static int dpp_hkdf_expand(size_t hash_len, const u8 *secret, size_t secret_len, in dpp_hkdf_expand() argument
115 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()
133 static int dpp_hmac_vector(size_t hash_len, const u8 *key, size_t key_len, in dpp_hmac_vector() argument
137 if (hash_len == 32) in dpp_hmac_vector()
141 if (hash_len == 48) in dpp_hmac_vector()
144 if (hash_len == 64) in dpp_hmac_vector()
152 static int dpp_hmac(size_t hash_len, const u8 *key, size_t key_len, in dpp_hmac() argument
155 if (hash_len == 32) in dpp_hmac()
158 if (hash_len == 48) in dpp_hmac()
160 if (hash_len == 64) in dpp_hmac()
833 unsigned int hash_len) in dpp_derive_k1() argument
842 os_memset(salt, 0, hash_len); in dpp_derive_k1()
843 if (dpp_hmac(hash_len, salt, hash_len, Mx, Mx_len, prk) < 0) in dpp_derive_k1()
846 prk, hash_len); in dpp_derive_k1()
849 res = dpp_hkdf_expand(hash_len, prk, hash_len, info, k1, hash_len); in dpp_derive_k1()
850 forced_memzero(prk, hash_len); in dpp_derive_k1()
855 k1, hash_len); in dpp_derive_k1()
861 unsigned int hash_len) in dpp_derive_k2() argument
870 os_memset(salt, 0, hash_len); in dpp_derive_k2()
871 res = dpp_hmac(hash_len, salt, hash_len, Nx, Nx_len, prk); in dpp_derive_k2()
875 prk, hash_len); in dpp_derive_k2()
878 res = dpp_hkdf_expand(hash_len, prk, hash_len, info, k2, hash_len); in dpp_derive_k2()
879 forced_memzero(prk, hash_len); in dpp_derive_k2()
884 k2, hash_len); in dpp_derive_k2()
890 unsigned int hash_len) in dpp_derive_ke() argument
929 res = dpp_hmac_vector(hash_len, nonces, 2 * nonce_len, in dpp_derive_ke()
934 prk, hash_len); in dpp_derive_ke()
937 res = dpp_hkdf_expand(hash_len, prk, hash_len, info_ke, ke, hash_len); in dpp_derive_ke()
938 forced_memzero(prk, hash_len); in dpp_derive_ke()
943 ke, hash_len); in dpp_derive_ke()
1109 if (aes_siv_encrypt(auth->k1, auth->curve->hash_len, clear, siv_len, in dpp_auth_build_req()
1282 if (aes_siv_encrypt(siv_key, auth->curve->hash_len, clear, siv_len, in dpp_auth_build_resp()
1601 auth->curve->hash_len) < 0) in dpp_auth_init()
1732 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_build_conf_req_attr()
1954 auth->curve->hash_len); in dpp_gen_r_auth()
2036 auth->curve->hash_len); in dpp_gen_i_auth()
2217 auth->curve->hash_len) < 0) in dpp_auth_build_resp_ok()
2226 if (dpp_derive_ke(auth, auth->ke, auth->curve->hash_len) < 0) in dpp_auth_build_resp_ok()
2231 WPA_PUT_LE16(&r_auth[2], auth->curve->hash_len); in dpp_auth_build_resp_ok()
2237 r_auth[4 + auth->curve->hash_len / 2] ^= 0x01; in dpp_auth_build_resp_ok()
2240 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_auth_build_resp_ok()
2241 r_auth, 4 + auth->curve->hash_len, in dpp_auth_build_resp_ok()
2244 wrapped_r_auth_len = 4 + auth->curve->hash_len + AES_BLOCK_SIZE; in dpp_auth_build_resp_ok()
2506 auth->curve->hash_len) < 0) in dpp_auth_req_rx()
2521 if (aes_siv_decrypt(auth->k1, auth->curve->hash_len, in dpp_auth_req_rx()
2688 i_auth_len = 4 + auth->curve->hash_len; in dpp_auth_build_conf()
2789 WPA_PUT_LE16(&i_auth[2], auth->curve->hash_len); in dpp_auth_build_conf()
2796 i_auth[4 + auth->curve->hash_len / 2] ^= 0x01; in dpp_auth_build_conf()
2800 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_auth_build_conf()
2816 if (aes_siv_encrypt(auth->k2, auth->curve->hash_len, in dpp_auth_build_conf()
2885 if (aes_siv_decrypt(auth->k1, auth->curve->hash_len, in dpp_auth_resp_rx_status()
3093 auth->curve->hash_len) < 0) in dpp_auth_resp_rx()
3108 if (aes_siv_decrypt(auth->k2, auth->curve->hash_len, in dpp_auth_resp_rx()
3192 if (dpp_derive_ke(auth, auth->ke, auth->curve->hash_len) < 0) in dpp_auth_resp_rx()
3199 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len, in dpp_auth_resp_rx()
3216 if (!r_auth || r_auth_len != auth->curve->hash_len) { in dpp_auth_resp_rx()
3290 if (aes_siv_decrypt(auth->k2, auth->curve->hash_len, in dpp_auth_conf_rx_failure()
3447 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len, in dpp_auth_conf_rx()
3463 if (!i_auth || i_auth_len != auth->curve->hash_len) { in dpp_auth_conf_rx()
3962 unsigned char *hash, int hash_len) in dpp_get_config_obj_hash() argument
3970 if (hash_len != SHA256_MAC_LEN) in dpp_get_config_obj_hash()
4100 hash = os_malloc(curve->hash_len); in dpp_build_conf_obj_dpp()
4104 if (dpp_get_config_obj_hash(signed1, signed1_len, signed2, signed1_len, hash, curve->hash_len) < 0) in dpp_build_conf_obj_dpp()
4109 if (crypto_ecdsa_get_sign(hash, r, s, auth->conf->csign, curve->hash_len) < 0) in dpp_build_conf_obj_dpp()
4380 if (aes_siv_encrypt(auth->ke, auth->curve->hash_len, in dpp_build_conf_resp()
4449 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len, in dpp_conf_req_rx()
5433 if (aes_siv_decrypt(auth->ke, auth->curve->hash_len, in dpp_conf_resp_rx()
5719 unsigned int hash_len) in dpp_derive_pmk() argument
5728 os_memset(salt, 0, hash_len); in dpp_derive_pmk()
5729 if (dpp_hmac(hash_len, salt, hash_len, Nx, Nx_len, prk) < 0) in dpp_derive_pmk()
5732 prk, hash_len); in dpp_derive_pmk()
5735 res = dpp_hkdf_expand(hash_len, prk, hash_len, info, pmk, hash_len); in dpp_derive_pmk()
5736 forced_memzero(prk, hash_len); in dpp_derive_pmk()
5741 pmk, hash_len); in dpp_derive_pmk()
5925 if (dpp_derive_pmk(Nx, Nx_len, intro->pmk, curve->hash_len) < 0) { in dpp_peer_intro()
5929 intro->pmk_len = curve->hash_len; in dpp_peer_intro()