prime?(p1 = v1)
Performs a Miller-Rabin probabilistic primality test with checks iterations. If checks is not specified, a number of iterations is used that yields a false positive rate of at most 2^-80 for random input.
checks - integer
static VALUE ossl_bn_is_prime(int argc, VALUE *argv, VALUE self) { BIGNUM *bn; VALUE vchecks; int checks = BN_prime_checks; if (rb_scan_args(argc, argv, "01", &vchecks) == 1) { checks = NUM2INT(vchecks); } GetBN(self, bn); switch (BN_is_prime_ex(bn, checks, ossl_bn_ctx, NULL)) { case 1: return Qtrue; case 0: return Qfalse; default: ossl_raise(eBNError, NULL); } /* not reachable */ return Qnil; }