[#BN_generate_prime] = BN_generate_prime :mrdocs: Generate a prime of approximately `bits` (deprecated; prefer BN_generate_prime_ex). == Synopsis Declared in `<openssl/bn.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[deprecated]] xref:BIGNUM.adoc[BIGNUM]* BN_generate_prime( xref:BIGNUM.adoc[BIGNUM]* ret, int bits, int safe, xref:BIGNUM.adoc[BIGNUM] const* add, xref:BIGNUM.adoc[BIGNUM] const* rem, void(* callback)(int, int, void*), void* cb_arg); ---- [WARNING] ==== https://en.cppreference.com/cpp/language/attributes/deprecated[Deprecated^]. Use of this entity is allowed but discouraged. ==== == Return Value Generated prime BIGNUM, or NULL on error. == Parameters [cols="1,4"] |=== | Name| Description | *ret* | Destination BIGNUM, or NULL to allocate a new one. | *bits* | Desired bit length of the prime. | *safe* | Nonzero to require a safe prime ((p‐1)/2 also prime). | *add* | Optional congruence modulus constraint, or NULL. | *rem* | Optional remainder for the `add` constraint, or NULL. | *callback* | Progress callback, or NULL. | *cb_arg* | User argument passed to `callback.` |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#