Branch Coverage

blib/lib/Digest/SHA/PurePerl.pm
Criterion Covered Total %
branch 143 262 54.5


line true false branch
434 161 29 unless defined $c[$pos >> 3]
442 9860 70228 unless defined $c[$pos >> 3]
449 1780 3 $bitcnt > 0 ? :
456 424 1096 if $self->{'alg'} >= 384
466 160 57 $alg <= 256 ? :
468 103 114 $alg == 1 ? :
469 103 114 if ($alg == 1) { }
4 110 elsif ($alg == 224) { }
53 57 elsif ($alg == 256) { }
27 30 elsif ($alg == 384) { }
26 4 elsif ($alg == 512) { }
2 2 elsif ($alg == 512224) { }
2 0 elsif ($alg == 512256) { }
483 1 153 unless grep {$alg == $_;} 1, 224, 256, 384, 512, 512224, 512256
484 0 153 if $alg >= 384 and not $uses64bit
499 525 91 if ($bitcnt > 0)
510 369 287 if ($self->{'blockcnt'} + $bitcnt >= $self->{'blocksize'}) { }
538 9 582 $bitcnt < $gap ? :
539 9 582 if $bitcnt < $gap
540 11 571 if ($self->{'blockcnt'} == $self->{'blocksize'})
545 3 579 if ($bitcnt -= $gap) == 0
556 1 915 unless $bitcnt > 0
559 5 910 if (($self->{'lenll'} += $bitcnt) >= $TWO32)
561 0 5 if (++$self->{'lenlh'} >= $TWO32)
563 0 0 if (++$self->{'lenhl'} >= $TWO32)
565 0 0 if (++$self->{'lenhh'} >= $TWO32)
573 247 668 if $blockcnt == 0
574 77 591 if $blockcnt % 8 == 0
609 12 86 unless $bytecnt > 0
610 1 85 unless utf8::downgrade($$bytestr_r, 1)
611 85 0 if $bytecnt <= $MWS
623 137 53 $self->{'alg'} <= 256 ? :
626 1202 21 if ($self->{'blockcnt'} < $self->{'blocksize'}) { }
638 53 137 if ($self->{'blocksize'} > 512)
663 9 2 if $numpads
687 0 32 unless defined $self->{$_}
691 2 2 $self->{'alg'} <= 256 ? :
695 16 16 $self->{'alg'} <= 256 ? :
717 8 88 if /^(#|$)/
724 0 11 unless grep {$_ == $s{'alg'};} 1, 224, 256, 384, 512, 512224, 512256
725 7 4 $s{'alg'} <= 256 ? :
0 11 unless length $s{'H'} == ($s{'alg'} <= 256 ? 64 : 128)
726 7 4 $s{'alg'} <= 256 ? :
0 11 unless length $s{'block'} == ($s{'alg'} <= 256 ? 128 : 256)
730 0 55 unless 0 <= $s{$_}
731 0 55 unless $s{$_} <= 4294967295
733 7 4 $s{'alg'} <= 256 ? :
0 11 unless $s{'blockcnt'} < ($s{'alg'} <= 256 ? 512 : 1024)
736 0 11 unless my $self = _shaopen($s{'alg'})
741 32 56 if ($self->{'alg'} > 256)
763 0 43 unless $self->{'isha'} = _shaopen($alg)
764 0 43 unless $self->{'osha'} = _shaopen($alg)
765 0 43 unless utf8::downgrade($key, 1)
766 11 32 if (length $key > $self->{'osha'}{'blocksize'} >> 3)
767 0 11 unless $self->{'ksha'} = _shaopen($alg)
813 0 1 unless my $state = _shaopen(1)
0 2 unless my $state = _shaopen(1)
0 5 unless my $state = _shaopen(1)
0 0 unless my $state = _shaopen(224)
0 2 unless my $state = _shaopen(224)
0 2 unless my $state = _shaopen(224)
0 0 unless my $state = _shaopen(256)
0 2 unless my $state = _shaopen(256)
0 2 unless my $state = _shaopen(256)
0 0 unless my $state = _shaopen(384)
0 2 unless my $state = _shaopen(384)
0 4 unless my $state = _shaopen(384)
0 0 unless my $state = _shaopen(512)
0 0 unless my $state = _shaopen(512224)
0 0 unless my $state = _shaopen(512224)
0 2 unless my $state = _shaopen(512224)
0 0 unless my $state = _shaopen(512256)
0 0 unless my $state = _shaopen(512256)
0 2 unless my $state = _shaopen(512256)
0 2 unless my $state = _shaopen(512)
0 5 unless my $state = _shaopen(512)
821 0 0 unless my $state = _hmacopen(1, pop @_)
0 0 unless my $state = _hmacopen(1, pop @_)
0 11 unless my $state = _hmacopen(1, pop @_)
0 0 unless my $state = _hmacopen(224, pop @_)
0 0 unless my $state = _hmacopen(224, pop @_)
0 0 unless my $state = _hmacopen(224, pop @_)
0 8 unless my $state = _hmacopen(256, pop @_)
0 0 unless my $state = _hmacopen(256, pop @_)
0 9 unless my $state = _hmacopen(256, pop @_)
0 8 unless my $state = _hmacopen(384, pop @_)
0 0 unless my $state = _hmacopen(384, pop @_)
0 0 unless my $state = _hmacopen(384, pop @_)
0 7 unless my $state = _hmacopen(512, pop @_)
0 0 unless my $state = _hmacopen(512224, pop @_)
0 0 unless my $state = _hmacopen(512224, pop @_)
0 0 unless my $state = _hmacopen(512224, pop @_)
0 0 unless my $state = _hmacopen(512256, pop @_)
0 0 unless my $state = _hmacopen(512256, pop @_)
0 0 unless my $state = _hmacopen(512256, pop @_)
0 0 unless my $state = _hmacopen(512, pop @_)
0 0 unless my $state = _hmacopen(512, pop @_)
863 11 5 if defined $alg
864 5 11 if (ref $class)
865 3 2 if (not defined $alg or $alg == $class->algorithm)
869 0 2 unless my $self = _shaopen($alg)
872 4 7 unless defined $alg
873 1 10 unless my $self = _shaopen($alg)
880 0 11 unless my $copy = _shadup($self)
888 38 653 unless (defined $nbits)
892 0 691 if $nbits > length($data) * 8
914 0 3 unless defined $n
926 1 0 unless (defined $_can_T_filehandle)
929 0 1 $@ ? :
930 1 0 $_can_T_filehandle ? :
932 0 0 $_can_T_filehandle ? :
939 2 4 unless ref \$file eq "SCALAR"
941 4 0 defined $mode ? :
951 0 4 if ($file eq '-') { }
952 0 0 if (-d STDIN)
953 0 0 unless sysopen FH, getcwd(), 2
956 0 0 unless open FH, "< -"
960 0 4 -d $file ? :
0 4 unless sysopen FH, $file, -d $file ? 2 : 0
964 2 2 if ($BITS)
970 0 2 unless defined $n
975 2 0 if $binary or $UNIVERSAL
976 1 1 if ($UNIVERSAL and _istext(*FH, $file)) { }
999 4 7 if (ref $class)
1000 0 4 unless my $self = _shaload($state)
1003 0 7 unless my $self = _shaload($state)
1012 0 0 unless my $state = $self->getstate
1013 0 0 if not defined $file or $file eq ""
1016 0 0 unless open FH, "> $file"
1027 0 0 if not defined $file or $file eq ""
1030 0 0 unless open FH, "< $file"