BN_primality_test function
BN_primality_test sets |*is_probably_prime| to one if |candidate| is probably a prime number by the Miller-Rabin test or zero if it's certainly not.
If |do_trial_division| is non-zero then |candidate| will be tested against a list of small primes before Miller-Rabin tests. The probability of this function returning a false positive is at most 2^{2*checks}. See |BN_prime_checks_for_validation| and |BN_prime_checks_for_generation| for recommended values of |checks|.
If |cb| is not NULL then it is called during the checking process. See the comment above |BN_GENCB|.
The function returns one on success and zero on error.
Implementation
@meta.RecordUse()
@ffi.Native<
ffi.Int Function(
ffi.Pointer<ffi.Int>,
ffi.Pointer<BIGNUM>,
ffi.Int,
ffi.Pointer<BN_CTX>,
ffi.Int,
ffi.Pointer<BN_GENCB>,
)
>(symbol: 'bssl_dart_BN_primality_test')
external int BN_primality_test(
ffi.Pointer<ffi.Int> is_probably_prime,
ffi.Pointer<BIGNUM> candidate,
int checks,
ffi.Pointer<BN_CTX> ctx,
int do_trial_division,
ffi.Pointer<BN_GENCB> cb,
);