Condition Coverage

lib/Crypt/CBC.pm
Criterion Covered Total %
condition 71 118 60.1


and 3 conditions

line !l l&&!r l&&r condition
61 28 8 2 defined $iv and length $iv != $bs
69 32 2 2 defined $key and length $key != $ks
83 0 0 2 defined $key && defined $iv
31 2 0 $pbkdf eq 'none' and not defined $key && defined $iv
86 31 1 1 $header_mode eq 'randomiv' and $pbkdf ne 'randomiv'
201 58 1702 0 $self->_needs_padding and $self->{'padding'} eq \&Crypt::CBC::_no_padding
1760 0 0 $self->_needs_padding and $self->{'padding'} eq \&Crypt::CBC::_no_padding and length($data) % $bs
206 58 1702 0 $self->_needs_padding and $self->{'padding'} eq \&Crypt::CBC::_rijndael_compat
1760 0 0 $self->_needs_padding and $self->{'padding'} eq \&Crypt::CBC::_rijndael_compat and length($data) % $bs
238 1690 70 0 length $block == 0 and $self->{'padding'} eq \&Crypt::CBC::_rijndael_compat
323 41 0 0 exists $options->{'prepend_iv'} and not $options->{'prepend_iv'}
324 41 0 0 exists $options->{'add_header'} and not $options->{'add_header'}
325 14 21 5 exists $options->{'pbkdf'} and $options->{'pbkdf'} eq 'none'
338 0 38 0 $padding and ref $padding eq 'CODE'
380 0 38 2 $options->{'cipher'} && ref $options->{'cipher'}
393 38 1 0 exists $options->{'literal_key'} and exists $options->{'regenerate_key'}
396 39 0 0 exists $options->{'regenerate_key'} and not $options->{'regenerate_key'}
400 31 1 7 defined $salt and $salt ne '1'
401 31 6 2 defined $salt and length $salt != 8
37 1 1 defined $salt and length $salt != 8 and $salt ne '1'
427 0 0 38 $iter =~ /[\d_]+/ and $iter >= 1
428 0 0 38 $iter =~ /[\d_]+/ and $iter >= 1
683 0 0 880 $self->{'key'} and $self->{'civ'}
711 0 0 880 defined $self->{'key'} and defined $self->{'civ'}
751 0 0 0 ref $alg and $alg->can('digest')
769 0 0 887 -r '/dev/urandom' and open F, '/dev/urandom'

or 2 conditions

line l !l condition
244 1760 0 $self->{'civ'} ||= ''
323 0 0 $header_mode ||= 'none'
324 0 0 $header_mode ||= 'none'
325 5 1 $header_mode ||= 'none'
326 20 21 $header_mode ||= 'salt'
336 9 29 $options->{'padding'} || 'standard'
384 0 2 $pass ||= ''
426 1 37 $options->{'iter'} || 10000

or 3 conditions

line l !l&&r !l&&!r condition
57 1 5 0 $key ||= $pass
298 39 0 0 $cipher->can('encrypt') or eval "require $cipher; 1"
325 1 16 24 $options->{'literal_key'} or exists $options->{'pbkdf'} and $options->{'pbkdf'} eq 'none'
363 40 0 0 $options->{'keysize'} || eval { do { $cipher->keysize } } || eval { do { $cipher->max_keysize } }
378 9 28 3 $options->{'pass'} || $options->{'key'}
407 1 0 37 $options->{'literal_key'} || exists $options->{'regenerate_key'} && !$options->{'regenerate_key'}
422 26 12 0 $options->{'pbkdf'} || ($options->{'literal_key'} ? 'none' : ($header_mode eq 'randomiv' ? 'randomiv' : 'opensslv1'))
645 3 1 0 $self->{'salt'} ||= $self->_get_random_bytes(8)