Advertisement
FrayxRulez

BN_primality_test

Apr 18th, 2017
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. int BN_primality_test(int *is_probably_prime, const BIGNUM *candidate,
  2.                       int checks, BN_CTX *ctx, int do_trial_division,
  3.                       BN_GENCB *cb) {
  4.   switch (BN_is_prime_fasttest_ex(candidate, checks, ctx, do_trial_division, cb)) {
  5.     case 1:
  6.       *is_probably_prime = 1;
  7.       return 1;
  8.     case 0:
  9.       *is_probably_prime = 0;
  10.       return 1;
  11.     default:
  12.       *is_probably_prime = 0;
  13.       return 0;
  14.   }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement