BN_is_prime

Probable-primality test without trial division (deprecated; prefer BN_check_prime()).

Synopsis

Declared in <openssl/bn.h>

[[deprecated]]
int
BN_is_prime(
    BIGNUM const* p,
    int nchecks,
    void(* callback)(int, int, void*),
    BN_CTX* ctx,
    void* cb_arg);

WARNING

Deprecated. Use of this entity is allowed but discouraged.

Return Value

1 if probably prime, 0 if composite, or -1 on error.

Parameters

NameDescription
pCandidate integer.
nchecksNumber of Miller-Rabin rounds (or BN_prime_checks for a size-based default).
callbackOptional old-style progress callback, or NULL.
ctxBN_CTX for temporaries, or NULL.
cb_argUser pointer passed to callback.