Home
last modified time | relevance | path

Searched refs:prime_len (Results 1 – 25 of 56) sorted by relevance

123

/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/common/
Dsae.c48 tmp->prime_len = crypto_ec_prime_len(tmp->ec); in sae_set_group()
61 tmp->prime_len = tmp->dh->prime_len; in sae_set_group()
62 if (tmp->prime_len > SAE_MAX_PRIME_LEN) { in sae_set_group()
68 tmp->prime_len); in sae_set_group()
160 prime, sae->tmp->prime_len, pwd_value, bits) < 0) in sae_test_pwd_seed_ecc()
163 buf_shift_right(pwd_value, sae->tmp->prime_len, 8 - bits % 8); in sae_test_pwd_seed_ecc()
165 pwd_value, sae->tmp->prime_len); in sae_test_pwd_seed_ecc()
167 cmp_prime = const_time_memcmp(pwd_value, prime, sae->tmp->prime_len); in sae_test_pwd_seed_ecc()
175 x_cand = crypto_bignum_init_set(pwd_value, sae->tmp->prime_len); in sae_test_pwd_seed_ecc()
198 size_t bits = sae->tmp->prime_len * 8; in sae_test_pwd_seed_ffc()
[all …]
Ddragonfly.c117 size_t prime_len; in dragonfly_is_quadratic_residue_blind() local
121 prime_len = crypto_ec_prime_len(ec); in dragonfly_is_quadratic_residue_blind()
156 const_time_select_bin(mask, qnr, qr, prime_len, qr_or_qnr_bin); in dragonfly_is_quadratic_residue_blind()
157 qr_or_qnr = crypto_bignum_init_set(qr_or_qnr_bin, prime_len); in dragonfly_is_quadratic_residue_blind()
226 size_t prime_len; in dragonfly_sqrt() local
231 prime_len = crypto_ec_prime_len(ec); in dragonfly_sqrt()
236 prime_len) < 0 || in dragonfly_sqrt()
237 (prime_bin[prime_len - 1] & 0x03) != 3 || in dragonfly_sqrt()
Ddpp_pkex.c87 attr_len += 4 + 2 * curve->prime_len; in dpp_pkex_build_exchange_req()
134 wpabuf_put_le16(msg, 2 * curve->prime_len); in dpp_pkex_build_exchange_req()
145 Mx = wpabuf_put(msg, curve->prime_len); in dpp_pkex_build_exchange_req()
146 My = wpabuf_put(msg, curve->prime_len); in dpp_pkex_build_exchange_req()
150 os_memcpy(pkex->Mx, Mx, curve->prime_len); in dpp_pkex_build_exchange_req()
230 attr_len += 4 + 2 * curve->prime_len; in dpp_pkex_build_exchange_resp()
282 wpabuf_put_le16(msg, 2 * curve->prime_len); in dpp_pkex_build_exchange_resp()
293 wpabuf_put_data(msg, Nx, curve->prime_len); in dpp_pkex_build_exchange_resp()
294 wpabuf_put_data(msg, Ny, curve->prime_len); in dpp_pkex_build_exchange_resp()
295 os_memcpy(pkex->Nx, Nx, curve->prime_len); in dpp_pkex_build_exchange_resp()
[all …]
Dsae_pk.c556 sig_data = wpabuf_alloc(tmp->prime_len * 6 + m_len + pubkey_len + in sae_pk_hash_sig_data()
560 pos = wpabuf_put(sig_data, 2 * tmp->prime_len); in sae_pk_hash_sig_data()
563 pos, pos + tmp->prime_len) < 0) in sae_pk_hash_sig_data()
565 pos = wpabuf_put(sig_data, 2 * tmp->prime_len); in sae_pk_hash_sig_data()
568 pos, pos + tmp->prime_len) < 0) in sae_pk_hash_sig_data()
572 wpabuf_put(sig_data, tmp->prime_len), in sae_pk_hash_sig_data()
573 tmp->prime_len, tmp->prime_len) < 0 || in sae_pk_hash_sig_data()
576 wpabuf_put(sig_data, tmp->prime_len), in sae_pk_hash_sig_data()
577 tmp->prime_len, tmp->prime_len) < 0) in sae_pk_hash_sig_data()
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/common/
Dsae.c46 tmp->prime_len = crypto_ec_prime_len(tmp->ec); in sae_set_group()
59 tmp->prime_len = tmp->dh->prime_len; in sae_set_group()
60 if (tmp->prime_len > SAE_MAX_PRIME_LEN) { in sae_set_group()
66 tmp->prime_len); in sae_set_group()
155 prime, sae->tmp->prime_len, pwd_value, bits) < 0) in sae_test_pwd_seed_ecc()
158 buf_shift_right(pwd_value, sae->tmp->prime_len, 8 - bits % 8); in sae_test_pwd_seed_ecc()
160 pwd_value, sae->tmp->prime_len); in sae_test_pwd_seed_ecc()
162 cmp_prime = const_time_memcmp(pwd_value, prime, sae->tmp->prime_len); in sae_test_pwd_seed_ecc()
170 x_cand = crypto_bignum_init_set(pwd_value, sae->tmp->prime_len); in sae_test_pwd_seed_ecc()
193 size_t bits = sae->tmp->prime_len * 8; in sae_test_pwd_seed_ffc()
[all …]
Ddragonfly.c117 size_t prime_len; in dragonfly_is_quadratic_residue_blind() local
121 prime_len = crypto_ec_prime_len(ec); in dragonfly_is_quadratic_residue_blind()
156 const_time_select_bin(mask, qnr, qr, prime_len, qr_or_qnr_bin); in dragonfly_is_quadratic_residue_blind()
157 qr_or_qnr = crypto_bignum_init_set(qr_or_qnr_bin, prime_len); in dragonfly_is_quadratic_residue_blind()
226 size_t prime_len; in dragonfly_sqrt() local
231 prime_len = crypto_ec_prime_len(ec); in dragonfly_sqrt()
236 prime_len) < 0 || in dragonfly_sqrt()
237 (prime_bin[prime_len - 1] & 0x03) != 3 || in dragonfly_sqrt()
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/crypto/
Dcrypto_internal-modexp.c16 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
21 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
23 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
28 pubkey_len = prime_len; in crypto_dh_init()
29 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
32 if (pubkey_len < prime_len) { in crypto_dh_init()
33 pad = prime_len - pubkey_len; in crypto_dh_init()
42 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
51 if (pubkey_len > prime_len || in crypto_dh_derive_secret()
52 (pubkey_len == prime_len && in crypto_dh_derive_secret()
[all …]
Ddh_groups.c1202 *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()
1247 shared_len = dh->prime_len; in dh_derive_shared()
1251 if (crypto_dh_derive_secret(*dh->generator, dh->prime, dh->prime_len, in dh_derive_shared()
Dcrypto_nettle.c307 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
312 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
314 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
319 pubkey_len = prime_len; in crypto_dh_init()
320 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
323 if (pubkey_len < prime_len) { in crypto_dh_init()
324 pad = prime_len - pubkey_len; in crypto_dh_init()
333 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
342 if (pubkey_len > prime_len || in crypto_dh_derive_secret()
343 (pubkey_len == prime_len && in crypto_dh_derive_secret()
[all …]
Dcrypto_gnutls.c286 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
291 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
293 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
298 pubkey_len = prime_len; in crypto_dh_init()
299 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
302 if (pubkey_len < prime_len) { in crypto_dh_init()
303 pad = prime_len - pubkey_len; in crypto_dh_init()
312 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
321 if (pubkey_len > prime_len || in crypto_dh_derive_secret()
322 (pubkey_len == prime_len && in crypto_dh_derive_secret()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/crypto/
Dcrypto_internal-modexp.c16 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
21 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
23 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
28 pubkey_len = prime_len; in crypto_dh_init()
29 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
32 if (pubkey_len < prime_len) { in crypto_dh_init()
33 pad = prime_len - pubkey_len; in crypto_dh_init()
42 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
51 if (pubkey_len > prime_len || in crypto_dh_derive_secret()
52 (pubkey_len == prime_len && in crypto_dh_derive_secret()
[all …]
Ddh_groups.c1202 *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()
1247 shared_len = dh->prime_len; in dh_derive_shared()
1251 if (crypto_dh_derive_secret(*dh->generator, dh->prime, dh->prime_len, in dh_derive_shared()
Dcrypto_nettle.c307 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
312 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
314 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
319 pubkey_len = prime_len; in crypto_dh_init()
320 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
323 if (pubkey_len < prime_len) { in crypto_dh_init()
324 pad = prime_len - pubkey_len; in crypto_dh_init()
333 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
342 if (pubkey_len > prime_len || in crypto_dh_derive_secret()
343 (pubkey_len == prime_len && in crypto_dh_derive_secret()
[all …]
Dcrypto_gnutls.c286 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
291 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
293 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
298 pubkey_len = prime_len; in crypto_dh_init()
299 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
302 if (pubkey_len < prime_len) { in crypto_dh_init()
303 pad = prime_len - pubkey_len; in crypto_dh_init()
312 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
321 if (pubkey_len > prime_len || in crypto_dh_derive_secret()
322 (pubkey_len == prime_len && in crypto_dh_derive_secret()
[all …]
Dcrypto_libtomcrypt.c700 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
705 if (os_get_random(privkey, prime_len) < 0) in crypto_dh_init()
707 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
712 pubkey_len = prime_len; in crypto_dh_init()
713 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
716 if (pubkey_len < prime_len) { in crypto_dh_init()
717 pad = prime_len - pubkey_len; in crypto_dh_init()
726 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
734 prime, prime_len, secret, len); in crypto_dh_derive_secret()
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/eap_server/
Deap_server_pwd.c240 size_t prime_len, order_len; in eap_pwd_build_commit_req() local
250 prime_len = crypto_ec_prime_len(data->grp->group); in eap_pwd_build_commit_req()
282 data->outbuf = wpabuf_alloc(2 * prime_len + order_len + in eap_pwd_build_commit_req()
294 element = wpabuf_put(data->outbuf, 2 * prime_len); in eap_pwd_build_commit_req()
298 element + prime_len) < 0) { in eap_pwd_build_commit_req()
317 size_t prime_len, order_len; in eap_pwd_build_confirm_req() local
327 prime_len = crypto_ec_prime_len(data->grp->group); in eap_pwd_build_confirm_req()
331 cruft = os_malloc(prime_len * 2); in eap_pwd_build_confirm_req()
352 crypto_bignum_to_bin(data->k, cruft, prime_len, prime_len); in eap_pwd_build_confirm_req()
353 eap_pwd_h_update(hash, cruft, prime_len); in eap_pwd_build_confirm_req()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/eap_server/
Deap_server_pwd.c240 size_t prime_len, order_len; in eap_pwd_build_commit_req() local
250 prime_len = crypto_ec_prime_len(data->grp->group); in eap_pwd_build_commit_req()
282 data->outbuf = wpabuf_alloc(2 * prime_len + order_len + in eap_pwd_build_commit_req()
294 element = wpabuf_put(data->outbuf, 2 * prime_len); in eap_pwd_build_commit_req()
298 element + prime_len) < 0) { in eap_pwd_build_commit_req()
317 size_t prime_len, order_len; in eap_pwd_build_confirm_req() local
327 prime_len = crypto_ec_prime_len(data->grp->group); in eap_pwd_build_confirm_req()
331 cruft = os_malloc(prime_len * 2); in eap_pwd_build_confirm_req()
352 crypto_bignum_to_bin(data->k, cruft, prime_len, prime_len); in eap_pwd_build_confirm_req()
353 eap_pwd_h_update(hash, cruft, prime_len); in eap_pwd_build_confirm_req()
[all …]
/third_party/openssl/crypto/dh/
Ddh_gen.c20 static int dh_builtin_genparams(DH *ret, int prime_len, int generator,
23 int DH_generate_parameters_ex(DH *ret, int prime_len, int generator, in DH_generate_parameters_ex() argument
27 return ret->meth->generate_params(ret, prime_len, generator, cb); in DH_generate_parameters_ex()
28 return dh_builtin_genparams(ret, prime_len, generator, cb); in DH_generate_parameters_ex()
61 static int dh_builtin_genparams(DH *ret, int prime_len, int generator, in dh_builtin_genparams() argument
112 if (!BN_generate_prime_ex(ret->p, prime_len, 1, t1, t2, cb)) in dh_builtin_genparams()
Ddh_pmeth.c25 int prime_len; member
57 dctx->prime_len = 2048; in pkey_dh_init()
87 dctx->prime_len = sctx->prime_len; in pkey_dh_copy()
118 dctx->prime_len = p1; in pkey_dh_ctrl()
292 int prime_len = dctx->prime_len; in dsa_dh_generate() local
301 if (prime_len >= 2048) in dsa_dh_generate()
307 if (prime_len >= 2048) in dsa_dh_generate()
313 rv = dsa_builtin_paramgen(ret, prime_len, subprime_len, md, in dsa_dh_generate()
316 rv = dsa_builtin_paramgen2(ret, prime_len, subprime_len, md, in dsa_dh_generate()
389 dctx->prime_len, dctx->generator, pcb); in pkey_dh_paramgen()
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/eap_peer/
Deap_pwd.c362 size_t prime_len, order_len; in eap_pwd_perform_commit_exchange() local
383 prime_len = crypto_ec_prime_len(data->grp->group); in eap_pwd_perform_commit_exchange()
396 if (payload_len != 2 * prime_len + order_len) { in eap_pwd_perform_commit_exchange()
400 (unsigned int) (2 * prime_len + order_len)); in eap_pwd_perform_commit_exchange()
432 exp_len = 1 + salt_len + 2 * prime_len + order_len; in eap_pwd_perform_commit_exchange()
469 exp_len = 1 + salt_len + 2 * prime_len + order_len; in eap_pwd_perform_commit_exchange()
504 exp_len = 1 + salt_len + 2 * prime_len + order_len; in eap_pwd_perform_commit_exchange()
540 if (payload_len != 2 * prime_len + order_len) { in eap_pwd_perform_commit_exchange()
544 (unsigned int) (2 * prime_len + order_len)); in eap_pwd_perform_commit_exchange()
618 ptr += prime_len * 2; in eap_pwd_perform_commit_exchange()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/eap_peer/
Deap_pwd.c362 size_t prime_len, order_len; in eap_pwd_perform_commit_exchange() local
383 prime_len = crypto_ec_prime_len(data->grp->group); in eap_pwd_perform_commit_exchange()
396 if (payload_len != 2 * prime_len + order_len) { in eap_pwd_perform_commit_exchange()
400 (unsigned int) (2 * prime_len + order_len)); in eap_pwd_perform_commit_exchange()
432 exp_len = 1 + salt_len + 2 * prime_len + order_len; in eap_pwd_perform_commit_exchange()
469 exp_len = 1 + salt_len + 2 * prime_len + order_len; in eap_pwd_perform_commit_exchange()
504 exp_len = 1 + salt_len + 2 * prime_len + order_len; in eap_pwd_perform_commit_exchange()
540 if (payload_len != 2 * prime_len + order_len) { in eap_pwd_perform_commit_exchange()
544 (unsigned int) (2 * prime_len + order_len)); in eap_pwd_perform_commit_exchange()
618 ptr += prime_len * 2; in eap_pwd_perform_commit_exchange()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9_standard/src/eap_common/
Deap_pwd_common.c339 size_t prime_len, order_len; in compute_keys() local
341 prime_len = crypto_ec_prime_len(grp->group); in compute_keys()
344 cruft = os_malloc(prime_len); in compute_keys()
371 crypto_bignum_to_bin(k, cruft, prime_len, prime_len); in compute_keys()
372 eap_pwd_h_update(hash, cruft, prime_len); in compute_keys()
412 size_t prime_len; in eap_pwd_get_element() local
415 prime_len = crypto_ec_prime_len(group->group); in eap_pwd_get_element()
418 if (!eap_pwd_element_coord_ok(prime, buf, prime_len) || in eap_pwd_get_element()
419 !eap_pwd_element_coord_ok(prime, buf + prime_len, prime_len)) { in eap_pwd_get_element()
Deap_eke_common.c171 if (crypto_dh_init(gen, dh->prime, dh->prime_len, ret_priv, in eap_eke_dh_init()
175 ret_priv, dh->prime_len); in eap_eke_dh_init()
177 ret_pub, dh->prime_len); in eap_eke_dh_init()
391 os_memcpy(peer_pub, peer_dhcomp + AES_BLOCK_SIZE, dh->prime_len); in eap_eke_shared_secret()
392 if (aes_128_cbc_decrypt(key, peer_dhcomp, peer_pub, dh->prime_len) < 0) { in eap_eke_shared_secret()
397 peer_pub, dh->prime_len); in eap_eke_shared_secret()
400 len = dh->prime_len; in eap_eke_shared_secret()
401 if (crypto_dh_derive_secret(*dh->generator, dh->prime, dh->prime_len, in eap_eke_shared_secret()
402 NULL, 0, dhpriv, dh->prime_len, peer_pub, in eap_eke_shared_secret()
403 dh->prime_len, modexp, &len) < 0) in eap_eke_shared_secret()
[all …]
/third_party/wpa_supplicant/wpa_supplicant-2.9/src/eap_common/
Deap_pwd_common.c339 size_t prime_len, order_len; in compute_keys() local
341 prime_len = crypto_ec_prime_len(grp->group); in compute_keys()
344 cruft = os_malloc(prime_len); in compute_keys()
371 crypto_bignum_to_bin(k, cruft, prime_len, prime_len); in compute_keys()
372 eap_pwd_h_update(hash, cruft, prime_len); in compute_keys()
412 size_t prime_len; in eap_pwd_get_element() local
415 prime_len = crypto_ec_prime_len(group->group); in eap_pwd_get_element()
418 if (!eap_pwd_element_coord_ok(prime, buf, prime_len) || in eap_pwd_get_element()
419 !eap_pwd_element_coord_ok(prime, buf + prime_len, prime_len)) { in eap_pwd_get_element()
Deap_eke_common.c171 if (crypto_dh_init(gen, dh->prime, dh->prime_len, ret_priv, in eap_eke_dh_init()
175 ret_priv, dh->prime_len); in eap_eke_dh_init()
177 ret_pub, dh->prime_len); in eap_eke_dh_init()
391 os_memcpy(peer_pub, peer_dhcomp + AES_BLOCK_SIZE, dh->prime_len); in eap_eke_shared_secret()
392 if (aes_128_cbc_decrypt(key, peer_dhcomp, peer_pub, dh->prime_len) < 0) { in eap_eke_shared_secret()
397 peer_pub, dh->prime_len); in eap_eke_shared_secret()
400 len = dh->prime_len; in eap_eke_shared_secret()
401 if (crypto_dh_derive_secret(*dh->generator, dh->prime, dh->prime_len, in eap_eke_shared_secret()
402 NULL, 0, dhpriv, dh->prime_len, peer_pub, in eap_eke_shared_secret()
403 dh->prime_len, modexp, &len) < 0) in eap_eke_shared_secret()
[all …]

123