Branch Coverage

blib/lib/Digest/SHA/PurePerl.pm
Criterion Covered Total %
branch 142 254 55.9


line true false branch
433 161 29 unless defined $c[$pos >> 3]
441 9860 70228 unless defined $c[$pos >> 3]
448 1803 3 $bitcnt > 0 ? :
455 424 1096 if $self->{'alg'} >= 384
465 160 57 $alg <= 256 ? :
467 103 114 $alg == 1 ? :
468 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) { }
482 1 153 unless grep {$alg == $_;} 1, 224, 256, 384, 512, 512224, 512256
483 0 153 if $alg >= 384 and not $uses64bit
498 532 91 if ($bitcnt > 0)
509 376 294 if ($self->{'blockcnt'} + $bitcnt >= $self->{'blocksize'}) { }
537 10 583 $bitcnt < $gap ? :
538 10 583 if $bitcnt < $gap
539 7 576 if ($self->{'blockcnt'} == $self->{'blocksize'})
544 3 580 if ($bitcnt -= $gap) == 0
555 1 930 unless $bitcnt > 0
558 5 925 if (($self->{'lenll'} += $bitcnt) >= $TWO32)
560 0 5 if (++$self->{'lenlh'} >= $TWO32)
562 0 0 if (++$self->{'lenhl'} >= $TWO32)
564 0 0 if (++$self->{'lenhh'} >= $TWO32)
572 247 683 if $blockcnt == 0
573 90 593 if $blockcnt % 8 == 0
608 12 86 unless $bytecnt > 0
609 1 85 unless utf8::downgrade($$bytestr_r, 1)
610 85 0 if $bytecnt <= $MWS
622 137 53 $self->{'alg'} <= 256 ? :
625 1202 21 if ($self->{'blockcnt'} < $self->{'blocksize'}) { }
637 53 137 if ($self->{'blocksize'} > 512)
662 9 2 if $numpads
686 0 32 unless defined $self->{$_}
690 2 2 $self->{'alg'} <= 256 ? :
694 16 16 $self->{'alg'} <= 256 ? :
716 8 88 if /^(#|$)/
723 0 11 unless grep {$_ == $s{'alg'};} 1, 224, 256, 384, 512, 512224, 512256
724 7 4 $s{'alg'} <= 256 ? :
0 11 unless length $s{'H'} == ($s{'alg'} <= 256 ? 64 : 128)
725 7 4 $s{'alg'} <= 256 ? :
0 11 unless length $s{'block'} == ($s{'alg'} <= 256 ? 128 : 256)
729 0 55 unless 0 <= $s{$_}
730 0 55 unless $s{$_} <= 4294967295
732 7 4 $s{'alg'} <= 256 ? :
0 11 unless $s{'blockcnt'} < ($s{'alg'} <= 256 ? 512 : 1024)
735 0 11 unless my $self = _shaopen($s{'alg'})
740 32 56 if ($self->{'alg'} > 256)
762 0 43 unless $self->{'isha'} = _shaopen($alg)
763 0 43 unless $self->{'osha'} = _shaopen($alg)
764 0 43 unless utf8::downgrade($key, 1)
765 11 32 if (length $key > $self->{'osha'}{'blocksize'} >> 3)
766 0 11 unless $self->{'ksha'} = _shaopen($alg)
812 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)
820 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 @_)
862 11 5 if defined $alg
863 5 11 if (ref $class)
864 3 2 if (not defined $alg or $alg == $class->algorithm)
868 0 2 unless my $self = _shaopen($alg)
871 4 7 unless defined $alg
872 1 10 unless my $self = _shaopen($alg)
879 0 11 unless my $copy = _shadup($self)
887 38 668 unless (defined $nbits)
891 0 706 if $nbits > length($data) * 8
913 0 3 unless defined $n
925 1 0 unless (defined $_can_T_filehandle)
928 0 1 $@ ? :
929 1 0 $_can_T_filehandle ? :
931 0 0 $_can_T_filehandle ? :
938 2 4 unless ref \$file eq 'SCALAR'
940 4 0 defined $mode ? :
950 0 4 -d $file ? :
0 4 unless $file eq '-' and open FH, '< -' or sysopen FH, $file, -d $file ? 2 : 0
954 2 2 if ($BITS)
960 0 2 unless defined $n
965 2 0 if $binary or $UNIVERSAL
966 1 1 if ($UNIVERSAL and _istext(*FH, $file)) { }
989 4 7 if (ref $class)
990 0 4 unless my $self = _shaload($state)
993 0 7 unless my $self = _shaload($state)
1002 0 0 unless my $state = $self->getstate
1003 0 0 if not defined $file or $file eq ''
1006 0 0 unless open FH, "> $file"
1017 0 0 if not defined $file or $file eq ''
1020 0 0 unless open FH, "< $file"