Branch Coverage

blib/lib/Math/Prime/Util/RandomPrimes.pm
Criterion Covered Total %
branch 104 206 50.4


line true false branch
20 0 4 unless (defined $Math::BigInt::VERSION)
43 0 3 if $_big_gcd_use >= 0
44 0 3 if (prime_get_config()->{'gmp'})
48 3 0 unless ('Math::BigInt'->config->{'lib'} =~ /^Math::BigInt::(GMP|Pari)/)
367 0 0 if (defined $cachearef) { }
370 0 0 $low <= 2 ? :
371 0 0 $high < 18446744073709551615 ? :
381 0 2 if $high < 2 or $low > $high
384 0 2 $low <= 2 ? :
385 0 2 $high == 18446744073709551615 ? :
386 0 2 if $low == $high and &is_prob_prime($low)
387 0 2 if $low >= $high
395 0 3 unless $digits >= 1
397 0 3 if $digits <= 6 and 1
401 1 2 if ($bigdigits and prime_get_config()->{'nobigint'})
402 0 1 if $digits > 20
405 1 0 unless (defined $_random_ndigit_ranges[$digits])
412 2 1 unless (defined $_random_ndigit_ranges[$digits])
413 2 0 if ($bigdigits) { }
437 0 15 unless $bits >= 2
441 0 15 if ($bits <= 20 and 1)
442 0 0 if ($bits <= 4)
443 0 0 if $bits == 2
444 0 0 if $bits == 3
445 0 0 if $bits == 4
470 6 9 if ($bits > 64)
471 3 3 $bits > 79 ? :
472 0 6 if $l == 63 and 0
473 0 6 if $bits - 2 < $l
476 6 0 unless ref $brand eq 'Math::BigInt'
486 580 218 if $zi >= $pm or defined $premod[$pm]
487 42 176 if ($twopremod * $zi + $bpremod) % $pm == 0
490 1 5 if $_big_gcd_use < 0
497 1 28 if $a % 3 == $premod[3] or $a % 5 == $premod[5] or $a % 7 == $premod[7] or $a % 11 == $premod[11] or $a % 13 == $premod[13] or $a % 17 == $premod[17] or $a % 19 == $premod[19]
507 6 22 unless Math::BigInt::bgcd($p, 1348781387) == 1
508 0 22 if ($_big_gcd_use and $p > $_big_gcd_top)
509 0 0 unless Math::BigInt::bgcd($p, $_big_gcd[0]) == 1
510 0 0 unless Math::BigInt::bgcd($p, $_big_gcd[1]) == 1
511 0 0 unless Math::BigInt::bgcd($p, $_big_gcd[2]) == 1
512 0 0 unless Math::BigInt::bgcd($p, $_big_gcd[3]) == 1
515 16 6 unless Math::Prime::Util::PP::is_bpsw_prime($p)
528 0 9 if ($bits > 64) { }
532 0 0 if &is_prob_prime($n)
538 9 158 if &is_prob_prime($n)
581 0 0 unless $k >= 2
584 0 0 if $k <= 64 and 1
587 0 0 unless verify_prime($cert)
594 0 10 unless $k >= 2
598 0 10 if ref $k eq 'Math::BigInt'
604 5 5 if ($k <= $p0)
607 0 5 if $isp != 2
613 0 5 if $verbose > 2
615 2 3 unless (defined $Math::BigFloat::VERSION)
624 5 0 if ($k > 2 * $m)
635 5 0 unless ref $q eq 'Math::BigInt'
637 0 5 if $verbose and $verbose != 3
638 5 0 $q < 'Math::BigInt'->new('18446744073709551615') ? :
642 1 4 if $_big_gcd_use < 0
655 0 81 if $verbose > 2
661 51 30 unless Math::BigInt::bgcd($n, 111546435)->is_one
662 0 30 if ($_big_gcd_use and $n > $_big_gcd_top)
663 0 0 unless Math::BigInt::bgcd($n, $_big_gcd[0])->is_one
664 0 0 unless Math::BigInt::bgcd($n, $_big_gcd[1])->is_one
665 0 0 unless Math::BigInt::bgcd($n, $_big_gcd[2])->is_one
666 0 0 unless Math::BigInt::bgcd($n, $_big_gcd[3])->is_one
668 0 30 if $verbose > 2
669 25 5 unless &is_strong_pseudoprime($n, 3)
671 0 5 if $verbose > 2
688 0 5 unless ($q->is_odd and $q > 2 and $m > 0 and $m * $q + $ONE == $n and $TWO * $q + $ONE > $n->copy->bsqrt)
697 0 11 unless $a->copy->bmodpow($R, $n) != $nm1
698 6 5 unless $a->copy->bmodpow($R * $q, $n) == $nm1
699 0 5 if $verbose > 2
700 0 5 unless &is_prob_prime($n)
720 0 2 unless $status
721 0 2 unless verify_prime($cert)
730 98 0 unless vec($s, $i, 8) == 0
737 0 6 if $k < 2
740 0 6 unless defined $input_seed and length $input_seed >= 32
743 0 6 unless (defined $Digest::SHA::VERSION)
748 0 0 unless (eval { do { require Digest::SHA; my $version = $Digest::SHA::VERSION; $version =~ s/[^\d.]//g; $version >= 4 } })
753 2 4 if ($k < 33)
769 2 30 if $isp
770 0 30 if $prime_gen_counter > 10000 + 16 * $k
775 0 4 unless $status
776 4 0 $c0 < 'Math::BigInt'->new('18446744073709551615') ? :
788 0 4 if $_big_gcd_use < 0
790 0 30 if (2 * $t * $c0 + 1 > 2 * $k2)
802 0 12 if ($looks_prime and $_big_gcd_use and $c > $_big_gcd_top)
808 8 22 if $looks_prime and not &is_strong_pseudoprime($c, 3)
811 4 26 if ($looks_prime) { }
821 4 0 if (Math::BigInt::bgcd($z - 1, $c)->is_one and $z->copy->bmodpow($c0, $c)->is_one)
822 0 4 unless &is_prob_prime($c)
836 0 26 if $prime_gen_counter > 10000 + 16 * $k + $old_counter
845 0 1 unless $t >= 128
857 0 1 unless ref $qp eq 'Math::BigInt'
858 0 1 unless ref $qpp eq 'Math::BigInt'
860 1 0 if $rem > 0
866 36 1 unless &is_prob_prime($q)
869 1 0 if $rem > 0
875 1 13 if &is_prob_prime($p)
884 0 0 unless verify_prime($cert)
892 0 1 if (prime_get_config()->{'gmp'} and $k <= 450)
895 0 0 if $isp != 2