Lines Matching defs:prime
21 * purposes: FFC groups whose prime is >= 3072 bits and ECC groups
22 * defined over a prime field whose prime is >= 256 bits. Furthermore,
26 * timing information due to the prime not being close to a power of
44 /* FFC groups that have prime that is close to a power of two */
53 int dragonfly_get_random_qr_qnr(const struct crypto_bignum *prime,
64 if (!tmp || crypto_bignum_rand(tmp, prime) < 0) {
69 res = crypto_bignum_legendre(tmp, prime);
91 dragonfly_get_rand_1_to_p_1(const struct crypto_bignum *prime)
99 crypto_bignum_sub(prime, one, pm1) < 0 ||
119 const struct crypto_bignum *prime;
123 prime = crypto_ec_get_prime(ec);
135 r = dragonfly_get_rand_1_to_p_1(prime);
141 crypto_bignum_mulmod(val, r, prime, num) < 0 ||
142 crypto_bignum_mulmod(num, r, prime, num) < 0)
162 crypto_bignum_mulmod(num, qr_or_qnr, prime, num) < 0)
168 res = crypto_bignum_legendre(num, prime);
225 const struct crypto_bignum *prime;
231 /* For prime p such that p = 3 mod 4, sqrt(w) = w^((p+1)/4) mod p */
233 prime = crypto_ec_get_prime(ec);
238 if (crypto_bignum_to_bin(prime, prime_bin, sizeof(prime_bin),
243 crypto_bignum_add(prime, one, tmp) < 0 ||
246 crypto_bignum_exptmod(val, tmp, prime, res) < 0)