BN_is_prime_fasttest_ex function

  1. @RecordUse.new()
  2. @Native<Int Function(Pointer<BIGNUM>, Int, Pointer<BN_CTX>, Int, Pointer<BN_GENCB>)>(ffi.Pointer<BIGNUM>, ffi.Int, ffi.Pointer<BN_CTX>, ffi.Int, ffi.Pointer<BN_GENCB>)>(symbol: 'bssl_dart_BN_is_prime_fasttest_ex')
int BN_is_prime_fasttest_ex(
  1. Pointer<BIGNUM> candidate,
  2. int checks,
  3. Pointer<BN_CTX> ctx,
  4. int do_trial_division,
  5. Pointer<BN_GENCB> cb,
)

BN_is_prime_fasttest_ex returns one if |candidate| is probably a prime number by the Miller-Rabin test, zero if it's certainly not and -1 on error.

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 one when |candidate| is composite 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|.

WARNING: deprecated. Use |BN_primality_test|.

Implementation

@meta.RecordUse()
@ffi.Native<
  ffi.Int Function(
    ffi.Pointer<BIGNUM>,
    ffi.Int,
    ffi.Pointer<BN_CTX>,
    ffi.Int,
    ffi.Pointer<BN_GENCB>,
  )
>(symbol: 'bssl_dart_BN_is_prime_fasttest_ex')
external int BN_is_prime_fasttest_ex(
  ffi.Pointer<BIGNUM> candidate,
  int checks,
  ffi.Pointer<BN_CTX> ctx,
  int do_trial_division,
  ffi.Pointer<BN_GENCB> cb,
);