Branch Coverage

blib/lib/Crypt/MagicSignatures/Key.pm
Criterion Covered Total %
branch 86 110 78.1


line true false branch
49 14 0 if (eval q[use Math::Prime::Util 'random_nbit_prime'; 1;])
64 4 28 if (my $bl = &blessed($_[0]))
67 2 2 if $bl->isa('Crypt::MagicSignatures::Key')
71 3 27 if (ref $_[0])
79 22 5 if (@_ == 1 and index($_[0], 'RSA.') >= 0) { }
3 2 elsif (@_ % 2 == 0) { }
98 2 20 unless ($mod = _b64url_to_hex($mod))
103 19 1 if $exp
104 9 11 if $private_exp
110 18 2 if $exp
113 9 11 if $private_exp
121 3 0 if (defined $param{'n'}) { }
127 6 3 if exists $param{$_}
131 2 1 unless ($self->n)
155 2 19 if ($size < 512 or $size > 4096)
171 0 0 unless ($GENERATOR)
183 0 0 if ($size) { }
186 0 0 if ($size < 512 or $size > 4096 or $size % 2)
224 0 0 unless (--$m > 0)
234 0 0 if _bitsize($n) == $size
239 0 0 unless ($m > 0)
248 0 0 if $e
257 0 0 if _bitsize($d) < $size / 4
278 133 22 unless $_[0]
284 1 21 if ($n->is_nan)
301 36 22 unless $_[0]
307 1 21 if ($e->is_nan)
321 24 10 unless $_[0]
327 1 9 if ($d->is_nan)
347 1 5 unless ($self->d)
365 2 13 unless ($encoded_message and $message)
374 1 12 unless ($encoded_message)
402 1 17 if ($_[0] and $self->d)
413 1 81 unless $_[0]
417 1 80 if utf8::is_utf8($v)
422 16 65 defined $_[1] ? :
6 75 unless defined $_[1] ? $_[1] : 1
430 2 91 unless $v
437 27 64 if ($padding = length($v) % 4)
463 0 6 unless my $EM = _emsa_encode($M, $k)
481 2 10 if (length $S != $k)
487 0 10 unless my $m = _rsavp1($K, $s)
488 0 10 unless my $EM = _emsa_encode($M, $k)
501 2 8 if ($m >= $K->n or $m < 0)
518 0 10 if ($s > $K->n or $s < 0)
534 0 18 unless $M
544 0 18 if ($emLen < $tLen + 11)
560 1 57 if $l > 30000
581 2 55 if $num->is_nan or $num->length > 30000
588 1 54 if ($l and $num > $base ** $l)
599 52 2 if $num != 0
601 14 40 if (length $result < $l)
621 1 64 unless $int
634 3 52 unless my $b64 = b64url_decode(shift())
648 20 20 length($num) % 2 > 0 ? :