Branch Coverage

blib/lib/Crypt/RSA/Key/Private.pm
Criterion Covered Total %
branch 55 80 68.7


line true false branch
25 1 4 if ($params{'Filename'}) { }
31 2 2 if $params{'Identity'}
33 4 0 if $params{'Password'}
44 135 14 if ($key =~ /^(e|n|d|p|q|dp|dq|u|phi)$/) { }
11 3 elsif ($key =~ /^Identity|Cipher|Password$/) { }
3 0 elsif ($key =~ /^Checked$/) { }
46 15 120 if (defined $value)
48 8 7 if (ref $value eq 'Math::BigInt') { }
0 7 elsif (ref $value eq 'Math::Pari') { }
56 113 22 if (defined $$prikey)
57 0 113 unless ref $$prikey eq 'Math::BigInt'
60 4 18 if defined $self->{'private_encrypted'}{"_$key"}
63 10 1 if $value
67 3 0 if $value and $package eq 'Crypt::RSA::Key::Private'
77 0 2 unless $self->{'Password'}
100 2 1 if $params{'Password'}
101 1 2 unless $self->{'Password'}
115 7 3 if $self->{'Checked'}
118 0 3 if $self->{'Hidden'}
120 0 0 unless $self->n and $self->d or $self->n and $self->p and $self->q
123 1 2 if ($self->p and $self->q)
124 0 1 if $self->n =~ /\D/
125 0 1 if $self->p =~ /\D/
126 0 1 if $self->q =~ /\D/
127 0 1 unless $self->n == $self->p * $self->q
128 0 1 unless &is_prime(scalar $self->p)
129 0 1 unless &is_prime(scalar $self->q)
132 1 2 if ($self->e)
134 0 1 if $self->e =~ /\D/
137 0 1 unless $KI == 1
140 1 2 if ($self->dp)
142 0 1 unless $self->dp == $self->d % ($self->p - 1)
145 1 2 if ($self->dq)
147 0 1 unless $self->dq == $self->d % ($self->q - 1)
150 1 0 if ($self->u and $self->q and $self->p)
152 0 1 unless $self->u == $m
178 0 1 unless open my $disk, '>', $params{'Filename'}
189 0 1 unless open my $disk, '<', $params{'Filename'}
203 0 1 if ($self->{'private'})
219 0 1 if ($self->{'private'})