CiFEr
|
Prime number related functions. More...
Go to the source code of this file.
Functions | |
bool | cfe_is_safe_prime (mpz_t p) |
cfe_error | cfe_get_prime (mpz_t res, size_t bits, bool safe) |
Prime number related functions.
bool cfe_is_safe_prime | ( | mpz_t | p | ) |
Checks whether the number passed as argument is a safe prime.
p | The number to be checked |
cfe_error cfe_get_prime | ( | mpz_t | res, |
size_t | bits, | ||
bool | safe | ||
) |
Sets the first argument to a prime with specified bit length. The prime will be a safe prime if the safe parameter is true.
res | The safe prime (result value is stored here) |
bits | Bit length of the safe prime |
safe | Boolean value if the prime will be safe or not |