Branch Coverage

blib/lib/Crypt/PK/ECC.pm
Criterion Covered Total %
branch 47 116 40.5


line true false branch
112 0 1 unless $crv
113 1 0 if (defined $k and length $k > 0) { }
0 0 elsif (defined $x and defined $y) { }
114 0 1 if length($k) % 2
118 0 0 if length($x) % 2
119 0 0 if length($y) % 2
120 0 0 if length $y != length $x
128 73 201 @_ > 0 ? :
135 0 8 unless $key
137 4 4 if $type =~ /\Aprivate(?:_short|_compressed)?\z/
139 4 0 if $type =~ /\Apublic(?:_short|_compressed)?\z/
146 0 0 unless defined $kh->{'curve_oid'}
147 0 0 unless defined $kh->{'curve_name'}
149 0 0 if ($type and $type eq 'private') { }
0 0 elsif ($type and $type eq 'public') { }
150 0 0 unless $kh->{'pub_x'} and $kh->{'pub_y'} and $kh->{'k'}
152 0 0 if length($kh->{$_}) % 2
162 0 0 $wanthash ? :
165 0 0 unless $kh->{'pub_x'} and $kh->{'pub_y'}
167 0 0 if length($kh->{$_}) % 2
174 0 0 $wanthash ? :
190 0 115 unless $key
193 1 114 if (ref $key eq "HASH")
194 1 0 if ($key->{'pub_x'} and $key->{'pub_y'} or $key->{'k'})
199 0 0 if ($key->{'crv'} and $key->{'kty'} and $key->{'kty'} eq "EC" and $key->{'d'} || $key->{'x'} && $key->{'y'})
203 0 0 if exists $key->{$_}
212 16 98 if (ref $key eq 'SCALAR') { }
98 0 elsif (-f $key) { }
221 0 114 unless $data
223 61 53 if ($data =~ /(-----BEGIN (PUBLIC|EC PRIVATE|PRIVATE|ENCRYPTED PRIVATE) KEY-----(.+?)-----END (PUBLIC|EC PRIVATE|PRIVATE|ENCRYPTED PRIVATE) KEY-----)/s) { }
0 53 elsif ($data =~ /-----BEGIN CERTIFICATE-----(.+?)-----END CERTIFICATE-----/s) { }
6 47 elsif ($data =~ /-----BEGIN OPENSSH PRIVATE KEY-----(.+?)-----END OPENSSH PRIVATE KEY-----/s) { }
3 44 elsif ($data =~ /---- BEGIN SSH2 PUBLIC KEY ----(.+?)---- END SSH2 PUBLIC KEY ----/s) { }
3 41 elsif ($data =~ /(ecdsa-\S+)\s+(\S+)/) { }
0 41 elsif ($data =~ /^\s*(\{.*?\})\s*$/s) { }
226 56 5 if $rv
240 3 0 if $pubkey and $typ =~ /^ecdsa-(.+?)-(.*)$/
246 0 0 if ($h->{'kty'} eq "EC")
247 0 0 if exists $h->{'x'}
248 0 0 if exists $h->{'y'}
249 0 0 if exists $h->{'d'}
259 41 0 if $rv
284 1 0 unless ref $key
285 0 1 unless ref $key eq __PACKAGE__
292 1 0 unless ref $key
293 0 1 unless ref $key eq __PACKAGE__
300 1 0 unless ref $key
301 0 1 unless ref $key eq __PACKAGE__
308 1 0 unless ref $key
309 0 1 unless ref $key eq __PACKAGE__
316 1 0 unless ref $key
317 0 1 unless ref $key eq __PACKAGE__
324 1 0 unless ref $key
325 0 1 unless ref $key eq __PACKAGE__
332 2 0 unless ref $privkey
333 2 0 unless ref $pubkey
334 0 2 unless ref $privkey eq __PACKAGE__ and $privkey->is_private
335 0 2 unless ref $pubkey eq __PACKAGE__