Branch Coverage

blib/lib/Crypt/PK/DH.pm
Criterion Covered Total %
branch 28 48 58.3


line true false branch
172 16 19 @_ > 0 ? :
177 0 24 unless $key
179 0 24 if (ref $key eq 'SCALAR') { }
24 0 elsif (-f $key) { }
188 0 24 unless $data
196 0 4 if (ref $param eq 'HASH') { }
4 0 elsif (my $dhparam = $DH_PARAMS{$param}) { }
197 0 0 unless $g = $param->{'g'}
198 0 0 unless $p = $param->{'p'}
208 2 2 if ($type eq 'private') { }
2 0 elsif ($type eq 'public') { }
222 3 4 if (not ref $param) { }
2 2 elsif (ref $param eq 'SCALAR') { }
2 0 elsif (ref $param eq 'HASH') { }
224 2 1 if $DH_PARAMS{$param}
226 1 0 if $param and $param =~ /^[0-9]+/
230 1 1 if ($data =~ /-----BEGIN DH PARAMETERS-----\s*(.+)\s*-----END DH PARAMETERS-----/s)
231 0 1 unless $data = pem_to_der($data)
236 0 2 unless my $g = $param->{'g'}
237 0 2 unless my $p = $param->{'p'}
249 4 0 unless ref $privkey
250 4 0 unless ref $pubkey
251 0 4 unless ref $privkey eq "Crypt::PK::DH" and $privkey->is_private
252 0 4 unless ref $pubkey eq "Crypt::PK::DH"