Condition Coverage

lib/Crypt/CBC.pm
Criterion Covered Total %
condition 74 121 61.1


and 3 conditions

line !l l&&!r l&&r condition
61 28 9 2 defined $iv and length $iv != $bs
69 32 3 2 defined $key and length $key != $ks
83 0 0 3 defined $key && defined $iv
31 3 0 $pbkdf eq 'none' and not defined $key && defined $iv
86 32 1 1 $header_mode eq 'randomiv' and $pbkdf ne 'randomiv'
201 59 1702 0 $self->_needs_padding and $self->{'padding'} eq \&Crypt::CBC::_no_padding
1761 0 0 $self->_needs_padding and $self->{'padding'} eq \&Crypt::CBC::_no_padding and length($data) % $bs
206 59 1702 0 $self->_needs_padding and $self->{'padding'} eq \&Crypt::CBC::_rijndael_compat
1761 0 0 $self->_needs_padding and $self->{'padding'} eq \&Crypt::CBC::_rijndael_compat and length($data) % $bs
238 1690 71 0 length $block == 0 and $self->{'padding'} eq \&Crypt::CBC::_rijndael_compat
254 865 13 3 length $block == 0 and not $self->_needs_padding
323 42 0 0 exists $options->{'prepend_iv'} and not $options->{'prepend_iv'}
324 42 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 39 0 $padding and ref $padding eq 'CODE'
380 0 39 2 $options->{'cipher'} && ref $options->{'cipher'}
393 38 2 0 exists $options->{'literal_key'} and exists $options->{'regenerate_key'}
396 40 0 0 exists $options->{'regenerate_key'} and not $options->{'regenerate_key'}
400 32 1 7 defined $salt and $salt ne '1'
401 32 6 2 defined $salt and length $salt != 8
38 1 1 defined $salt and length $salt != 8 and $salt ne '1'
427 0 0 39 $iter =~ /[\d_]+/ and $iter >= 1
428 0 0 39 $iter =~ /[\d_]+/ and $iter >= 1
684 0 0 880 $self->{'key'} and $self->{'civ'}
712 0 0 881 defined $self->{'key'} and defined $self->{'civ'}
752 0 0 0 ref $alg and $alg->can('digest')
770 0 0 888 -r '/dev/urandom' and open F, '/dev/urandom'

or 2 conditions

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

or 3 conditions

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