Generate a probable prime of the requested size and congruence constraints.
Declared in <openssl/bn.h>
int
BN_generate_prime_ex(
BIGNUM* ret,
int bits,
int safe,
BIGNUM const* add,
BIGNUM const* rem,
BN_GENCB* cb);
1 on success, or 0 on failure.
| Name | Description |
|---|---|
| ret | Destination BIGNUM for the prime. |
| bits | Desired bit length. |
| safe | Non-zero to require a safe prime ((p-1)/2 also prime). |
| add | Optional modulus for the constraint ret ≡ rem (mod add), or NULL. |
| rem | Optional residue for that constraint, or NULL (defaults to 1). |
| cb | Optional generation callback, or NULL. |