Branch Coverage

blib/lib/Crypt/SRP.pm
Criterion Covered Total %
branch 62 150 41.3


line true false branch
205 0 0 unless eval { do { require Storable } }
212 0 0 unless eval { do { require Storable } }
214 0 0 if ref $s ne "HASH" or not defined $s->{'__VER__'}
215 0 0 if $s->{'__VER__'} ne $VERSION
230 2 2 if defined $Bytes_B
231 0 4 if defined $Bytes_A
232 1 3 if defined $Bytes_a
233 1 3 if (defined $Bytes_a and not defined $Bytes_A)
246 1 1 if defined $Bytes_A
247 1 1 if defined $Bytes_B
248 1 1 if defined $Bytes_b
249 0 2 if (defined $Bytes_b and not defined $Bytes_B)
278 0 1 unless defined $Bytes_M2 and defined $M2 and $Bytes_M2 eq $M2
295 0 0 unless $I
315 0 1 unless $Bytes_M1 eq $M1
355 0 0 unless $self->_validate_A_or_B($Bytes_A)
363 0 0 unless $self->_validate_A_or_B($Bytes_B)
370 0 0 unless ref $self
380 1 5 if (@_ == 1 and ref $_[0] eq 'HASH') { }
389 6 0 if ($use_defaults) { }
399 0 0 if defined $args{'group'}
400 0 0 if defined $args{'hash'}
401 0 0 if defined $args{'format'}
402 0 0 if defined $args{'interleaved'}
403 0 0 if defined $args{'saltlen'}
404 0 0 if defined $args{'appletv'}
405 0 0 if defined $args{'srptools'}
415 6 0 if ($self->{'GROUP'} =~ /RFC5054-(1024|1536|2048|3072|4096|6144|8192)bit$/) { }
418 6 0 unless $str =~ /^0x/
428 0 6 unless defined $self->_HASH("test")
434 38 0 if $self->{'HASH'} =~ /^SHA(1|256|384|512)$/
443 0 0 if @all_bytes % 2
456 14 5 if length $data >= $self->{'N_LENGTH'}
462 0 4 unless defined $self->{'Bytes_s'} and defined $self->{'Bytes_I'} and defined $self->{'Bytes_P'}
471 0 2 unless defined $self->{'Num_x'} and defined $self->{'Num_N'} and defined $self->{'Num_g'}
480 0 2 unless defined $self->{'Num_a'} and defined $self->{'Num_N'} and defined $self->{'Num_g'}
488 0 3 unless defined $self->{'Num_A'} and defined $self->{'Num_B'}
497 0 3 unless defined $self->{'Num_N'} and defined $self->{'Num_g'}
505 0 2 unless defined $self->{'Num_B'} and defined $self->{'Num_a'} and defined $self->{'Num_u'} and defined $self->{'Num_k'}
506 0 2 unless defined $self->{'Num_x'} and defined $self->{'Num_N'} and defined $self->{'Num_g'}
514 2 0 if $tmp3 < 0
521 0 1 unless defined $self->{'Num_A'} and defined $self->{'Num_b'} and defined $self->{'Num_u'}
522 0 1 unless defined $self->{'Num_v'} and defined $self->{'Num_N'}
531 0 3 unless defined $self->{'Num_S'}
534 0 3 if ($self->{'SRPTOOLS'}) { }
1 2 elsif ($self->{'APPLETV'}) { }
536 0 0 $self->{'INTERLEAVED'} ? :
544 0 2 $self->{'INTERLEAVED'} ? :
551 0 3 unless defined $self->{'Num_A'} and defined $self->{'Num_B'} and defined $self->{'Num_N'} and defined $self->{'Num_g'}
552 0 3 unless defined $self->{'Bytes_K'} and defined $self->{'Bytes_I'} and defined $self->{'Bytes_s'}
554 1 2 if ($self->{'SRPTOOLS'} or $self->{'APPLETV'}) { }
571 0 2 unless defined $self->{'Bytes_K'} and defined $self->{'Num_A'} and defined $self->{'Bytes_M1'}
573 0 2 if ($self->{'SRPTOOLS'} or $self->{'APPLETV'}) { }
586 0 1 unless defined $self->{'Num_k'} and defined $self->{'Num_b'} and defined $self->{'Num_N'} and defined $self->{'Num_g'}
597 2 0 if (defined $pre)
599 0 2 unless $result->bcmp($min) >= 0
600 0 2 unless $result->bcmp($max) <= 0
604 0 0 if $len < 32
608 0 0 if $result->bcmp($min) >= 0
625 0 0 unless $bytes and $self->{'Num_N'}
627 0 0 unless $num
628 0 0 if $num->bmod($self->{'Num_N'}) == 0
641 0 54 unless defined $bignum and ref $bignum eq "Math::BigInt"
647 0 19 unless defined $bytes
654 0 18 unless defined $bytes
655 17 1 if $format eq "raw"
656 1 0 if $format eq "hex"
657 0 0 if $format eq "base64"
658 0 0 if $format eq "base64url"
665 0 16 unless defined $input
666 15 1 if $format eq "raw"
667 1 0 if $format eq "hex"
668 0 0 if $format eq "base64"
669 0 0 if $format eq "base64url"
676 7 48 if length($hex) % 2