Next: Checking, Up: Prime numbers [Contents][Index]
Generate a new prime number of prime_bits bits and store it in
prime. If factor_bits is non-zero, one of the prime factors
of (prime - 1) / 2 must be factor_bits bits long. If
factors is non-zero, allocate a new, NULL
-terminated array
holding the prime factors and store it in factors. flags
might be used to influence the prime number generation process.
Find a generator for prime where the factorization of
(prime - 1) is in the NULL
terminated array factors.
Return the generator as a newly allocated MPI in r_g. If
start_g is not NULL
, use this as the start for the search.
Convenience function to release the factors array.