BN_check_prime

Test whether p is prime using the library's default primality checks.

Synopsis

Declared in <openssl/bn.h>

int
BN_check_prime(
    BIGNUM const* p,
    BN_CTX* ctx,
    BN_GENCB* cb);

Return Value

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

Parameters

NameDescription
pCandidate integer.
ctxOptional BN_CTX, or NULL to allocate internally.
cbOptional progress callback, or NULL.