[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
12.1 Generation | Generation of new prime numbers. | |
12.2 Checking | Checking if a given number is prime. |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [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.
gcry_mpi_t prime, gcry_mpi_t *factors, gcry_mpi_t start_g)
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.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Check wether the number p is prime. Returns zero in case p
is indeed a prime, returns GPG_ERR_NO_PRIME
in case p is
not a prime and a different error code in case something went horribly
wrong.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated by root on July, 2 2008 using texi2html 1.78.