BN_generate_prime

Generate a prime of approximately bits (deprecated; prefer BN_generate_prime_ex).

Synopsis

Declared in <openssl/bn.h>

[[deprecated]]
BIGNUM*
BN_generate_prime(
    BIGNUM* ret,
    int bits,
    int safe,
    BIGNUM const* add,
    BIGNUM const* rem,
    void(* callback)(int, int, void*),
    void* cb_arg);

WARNING

Deprecated. Use of this entity is allowed but discouraged.

Return Value

Generated prime BIGNUM, or NULL on error.

Parameters

NameDescription
retDestination BIGNUM, or NULL to allocate a new one.
bitsDesired bit length of the prime.
safeNonzero to require a safe prime ((p-1)/2 also prime).
addOptional congruence modulus constraint, or NULL.
remOptional remainder for the add constraint, or NULL.
callbackProgress callback, or NULL.
cb_argUser argument passed to callback.