— Function: gcry_error_t **gcry_prime_generate** (`gcry_mpi_t *prime,unsigned int prime_bits, unsigned int factor_bits, gcry_mpi_t **factors, gcry_prime_check_func_t cb_func, void *cb_arg, gcry_random_level_t random_level, unsigned int flags`)

Generate a new prime number of

prime_bitsbits and store it inprime. Iffactor_bitsis non-zero, one of the prime factors of (prime- 1) / 2 must befactor_bitsbits long. Iffactorsis non-zero, allocate a new,`NULL`

-terminated array holding the prime factors and store it infactors.flagsmight be used to influence the prime number generation process.

— Function: gcry_error_t **gcry_prime_group_generator** (`gcry_mpi_t *r_g, gcry_mpi_t prime, gcry_mpi_t *factors, gcry_mpi_t start_g`)

Find a generator for

primewhere the factorization of (prime-1) is in the`NULL`

terminated arrayfactors. Return the generator as a newly allocated MPI inr_g. Ifstart_gis not NULL, use this as the start for the search.