Lines Matching refs:prime

593 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()
1772 BN_clear_free(e->prime); in crypto_ec_deinit()
1791 return BN_num_bytes(e->prime); in crypto_ec_prime_len()
1797 return BN_num_bits(e->prime); in crypto_ec_prime_len_bits()
1809 return (const struct crypto_bignum *) e->prime; in crypto_ec_get_prime()
1862 int len = BN_num_bytes(e->prime); in crypto_ec_point_to_bin()
1895 int len = BN_num_bytes(e->prime); in crypto_ec_point_from_bin()
1967 BN_mod_sqr(tmp, (const BIGNUM *) x, e->prime, e->bnctx) && in crypto_ec_point_compute_y_sqr()
1968 BN_mod_add_quick(tmp, e->a, tmp, e->prime) && in crypto_ec_point_compute_y_sqr()
1969 BN_mod_mul(tmp, tmp, (const BIGNUM *) x, e->prime, e->bnctx) && in crypto_ec_point_compute_y_sqr()
1970 BN_mod_add_quick(tmp, tmp, e->b, e->prime)) in crypto_ec_point_compute_y_sqr()
2127 int len = BN_num_bytes(ecdh->ec->prime); in crypto_ecdh_get_pubkey()
2785 BIGNUM *prime = NULL; in crypto_ec_key_sign_r_s() local
2802 prime = BN_new(); in crypto_ec_key_sign_r_s()
2803 if (!prime || !group || in crypto_ec_key_sign_r_s()
2804 !EC_GROUP_get_curve_GFp(group, prime, NULL, NULL, NULL)) in crypto_ec_key_sign_r_s()
2806 prime_len = BN_num_bytes(prime); in crypto_ec_key_sign_r_s()
2825 BN_free(prime); in crypto_ec_key_sign_r_s()