[#BN_generate_prime_ex] = BN_generate_prime_ex :mrdocs: Generate a probable prime of the requested size and congruence constraints. == Synopsis Declared in `<openssl/bn.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- int BN_generate_prime_ex( xref:BIGNUM.adoc[BIGNUM]* ret, int bits, int safe, xref:BIGNUM.adoc[BIGNUM] const* add, xref:BIGNUM.adoc[BIGNUM] const* rem, xref:BN_GENCB.adoc[BN_GENCB]* cb); ---- == Return Value 1 on success, or 0 on failure. == Parameters [cols="1,4"] |=== | 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#