Home
last modified time | relevance | path

Searched refs:prime (Results 1 – 19 of 19) sorted by relevance

/hostap-3.7.0/src/common/
Ddragonfly.c53 int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime, in dragonfly_get_random_qr_qnr() argument
64 if (!tmp || crypto_bignum_rand(tmp, prime) < 0) { in dragonfly_get_random_qr_qnr()
69 res = crypto_bignum_legendre(tmp, prime); in dragonfly_get_random_qr_qnr()
91 dragonfly_get_rand_1_to_p_1(const struct crypto_bignum *prime) in dragonfly_get_rand_1_to_p_1() argument
99 crypto_bignum_sub(prime, one, pm1) < 0 || in dragonfly_get_rand_1_to_p_1()
119 const struct crypto_bignum *prime; in dragonfly_is_quadratic_residue_blind() local
123 prime = crypto_ec_get_prime(ec); in dragonfly_is_quadratic_residue_blind()
135 r = dragonfly_get_rand_1_to_p_1(prime); in dragonfly_is_quadratic_residue_blind()
141 crypto_bignum_mulmod(val, r, prime, num) < 0 || in dragonfly_is_quadratic_residue_blind()
142 crypto_bignum_mulmod(num, r, prime, num) < 0) in dragonfly_is_quadratic_residue_blind()
[all …]
Dsae.c49 tmp->prime = crypto_ec_get_prime(tmp->ec); in sae_set_group()
67 tmp->prime_buf = crypto_bignum_init_set(tmp->dh->prime, in sae_set_group()
73 tmp->prime = tmp->prime_buf; in sae_set_group()
146 const u8 *prime, const u8 *qr, const u8 *qnr, in sae_test_pwd_seed_ecc() argument
160 prime, sae->tmp->prime_len, pwd_value, bits) < 0) 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()
208 sae->tmp->dh->prime, sae->tmp->prime_len, pwd_value, in sae_test_pwd_seed_ffc()
215 res = const_time_memcmp(pwd_value, sae->tmp->dh->prime, in sae_test_pwd_seed_ffc()
249 crypto_bignum_sub(sae->tmp->prime, b, b) < 0 || in sae_test_pwd_seed_ffc()
257 res = crypto_bignum_exptmod(a, b, sae->tmp->prime, pwe); in sae_test_pwd_seed_ffc()
[all …]
Ddragonfly.h20 int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime,
Dsae.h55 const struct crypto_bignum *prime; member
/hostap-3.7.0/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
23 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
29 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_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
53 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret()
70 bignum_set_unsigned_bin(p, prime, prime_len) < 0 || in crypto_dh_derive_secret()
82 prime, prime_len, secret, len); in crypto_dh_derive_secret()
Dcrypto_wolfssl.c782 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
803 if (wc_DhSetKey(dh, prime, prime_len, &generator, 1) != 0) in crypto_dh_init()
832 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
847 if (wc_DhSetKey(dh, prime, prime_len, &generator, 1) != 0) in crypto_dh_derive_secret()
1311 mp_int prime; member
1366 mp_init(&e->prime) != MP_OKAY || in crypto_ec_init()
1371 mp_read_radix(&e->prime, e->key.dp->prime, 16) != MP_OKAY || in crypto_ec_init()
1373 mp_montgomery_setup(&e->prime, &e->mont_b) != MP_OKAY) in crypto_ec_init()
1393 mp_clear(&e->prime); in crypto_ec_deinit()
1412 return (mp_count_bits(&e->prime) + 7) / 8; in crypto_ec_prime_len()
[all …]
Dcrypto_nettle.c307 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
314 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
320 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_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
344 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret()
358 mpz_import(p, prime_len, 1, 1, 1, 0, prime); in crypto_dh_derive_secret()
368 prime, prime_len, secret, len); in crypto_dh_derive_secret()
Dcrypto_gnutls.c286 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
293 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
299 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_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
323 os_memcmp(pubkey, prime, prime_len) >= 0)) in crypto_dh_derive_secret()
338 gcry_mpi_scan(&p, GCRYMPI_FMT_USG, prime, prime_len, in crypto_dh_derive_secret()
354 prime, prime_len, secret, len); in crypto_dh_derive_secret()
Dcrypto_openssl.c593 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
600 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
606 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_len, in crypto_dh_init()
619 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len, in crypto_dh_derive_secret() argument
629 p = BN_bin2bn(prime, prime_len, NULL); in crypto_dh_derive_secret()
654 prime, prime_len, secret, len); in crypto_dh_derive_secret()
1690 BIGNUM *prime; member
1749 e->prime = BN_new(); in crypto_ec_init()
1753 if (e->group == NULL || e->bnctx == NULL || e->prime == NULL || in crypto_ec_init()
1755 !EC_GROUP_get_curve_GFp(e->group, e->prime, e->a, e->b, e->bnctx) || in crypto_ec_init()
[all …]
Dcrypto_libtomcrypt.c700 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, in crypto_dh_init() argument
707 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
713 if (crypto_mod_exp(&generator, 1, privkey, prime_len, prime, prime_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()
Ddh_groups.c1213 if (crypto_dh_init(*dh->generator, dh->prime, dh->prime_len, in dh_init()
1251 if (crypto_dh_derive_secret(*dh->generator, dh->prime, dh->prime_len, in dh_derive_shared()
Ddh_groups.h16 const u8 *prime; member
Dcrypto_mbedtls.c876 u8 generator, const u8 *prime, size_t prime_len, const u8 *order, in crypto_dh_derive_secret() argument
881 prime, prime_len, privkey, privkey_len, pubkey, pubkey_len, secret, in crypto_dh_derive_secret()
886 u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, u8 *pubkey) in crypto_dh_init() argument
893 if (os_memcmp(privkey, prime, prime_len) > 0) { in crypto_dh_init()
900 &generator, 1, privkey, prime_len, prime, prime_len, pubkey, in crypto_dh_init()
Dcrypto_mbedtls_alt.c1406 static int crypto_mbedtls_dh_set_bin_pg(mbedtls_dhm_context *ctx, u8 generator, const u8 *prime, si… in crypto_mbedtls_dh_set_bin_pg() argument
1412 int ret = mbedtls_mpi_lset(&G, generator) || mbedtls_mpi_read_binary(&P, prime, prime_len) || in crypto_mbedtls_dh_set_bin_pg()
1420 …mbedtls_dhm_context *ctx, u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, u8 *pubkey) in crypto_mbedtls_dh_init_public() argument
1422 if (crypto_mbedtls_dh_set_bin_pg(ctx, generator, prime, prime_len) || in crypto_mbedtls_dh_init_public()
1430 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, u8 *pubkey) in crypto_dh_init() argument
1439 int ret = crypto_mbedtls_dh_init_public(&ctx, generator, prime, prime_len, privkey, pubkey); in crypto_dh_init()
1447 const u8 *prime, in crypto_dh_derive_secret() argument
1481 os_memcpy(buf + 2, prime, prime_len); in crypto_dh_derive_secret()
1519 const unsigned char *const prime = RFC3526_PRIME_1536; in dh5_init() local
1530 … crypto_mbedtls_dh_init_public(ctx, generator, prime, prime_len, wpabuf_put(wpriv, prime_len), in dh5_init()
[all …]
Dcrypto.h420 int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey,
422 int crypto_dh_derive_secret(u8 generator, const u8 *prime, size_t prime_len,
/hostap-3.7.0/src/eap_common/
Deap_pwd_common.c139 const struct crypto_bignum *prime; in compute_password_element() local
150 prime = crypto_ec_get_prime(grp->group); in compute_password_element()
153 if (crypto_bignum_to_bin(prime, prime_bin, sizeof(prime_bin), in compute_password_element()
164 if (dragonfly_get_random_qr_qnr(prime, &qr, &qnr) < 0 || in compute_password_element()
275 crypto_bignum_sub(prime, y, y) < 0 || in compute_password_element()
392 static int eap_pwd_element_coord_ok(const struct crypto_bignum *prime, in eap_pwd_element_coord_ok() argument
400 crypto_bignum_cmp(val, prime) >= 0) in eap_pwd_element_coord_ok()
411 const struct crypto_bignum *prime; in eap_pwd_get_element() local
414 prime = crypto_ec_get_prime(group->group); in eap_pwd_get_element()
418 if (!eap_pwd_element_coord_ok(prime, buf, prime_len) || in eap_pwd_get_element()
[all …]
Deap_eke_common.c171 if (crypto_dh_init(gen, dh->prime, dh->prime_len, ret_priv, in eap_eke_dh_init()
401 if (crypto_dh_derive_secret(*dh->generator, dh->prime, dh->prime_len, in eap_eke_shared_secret()
/hostap-3.7.0/hostapd/
DChangeLog82 in REVmd (allow only FFC groups with prime >= 3072 bits and ECC
83 groups with prime >= 256)
97 - disallow ECC groups with a prime under 256 bits (groups 25, 26, and
/hostap-3.7.0/wpa_supplicant/
DChangeLog99 in REVmd (allow only FFC groups with prime >= 3072 bits and ECC
100 groups with prime >= 256)
112 - disallow ECC groups with a prime under 256 bits (groups 25, 26, and