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'
202 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
207 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
239 1690 71 0 length $block == 0 and $self->{'padding'} eq \&Crypt::CBC::_rijndael_compat
255 865 13 3 length $block == 0 and not $self->_needs_padding
324 42 0 0 exists $options->{'prepend_iv'} and not $options->{'prepend_iv'}
325 42 0 0 exists $options->{'add_header'} and not $options->{'add_header'}
326 14 21 5 exists $options->{'pbkdf'} and $options->{'pbkdf'} eq 'none'
339 0 39 0 $padding and ref $padding eq 'CODE'
381 0 39 2 $options->{'cipher'} && ref $options->{'cipher'}
394 38 2 0 exists $options->{'literal_key'} and exists $options->{'regenerate_key'}
397 40 0 0 exists $options->{'regenerate_key'} and not $options->{'regenerate_key'}
401 32 1 7 defined $salt and $salt ne '1'
402 32 6 2 defined $salt and length $salt != 8
38 1 1 defined $salt and length $salt != 8 and $salt ne '1'
428 0 0 39 $iter =~ /[\d_]+/ and $iter >= 1
429 0 0 39 $iter =~ /[\d_]+/ and $iter >= 1
687 0 0 880 $self->{'key'} and $self->{'civ'}
715 0 0 881 defined $self->{'key'} and defined $self->{'civ'}
755 0 0 0 ref $alg and $alg->can('digest')
773 0 0 888 -r '/dev/urandom' and open F, '/dev/urandom'

or 2 conditions

line l !l condition
245 1761 0 $self->{'civ'} ||= ''
324 0 0 $header_mode ||= 'none'
325 0 0 $header_mode ||= 'none'
326 6 1 $header_mode ||= 'none'
327 21 21 $header_mode ||= 'salt'
337 10 29 $options->{'padding'} || 'standard'
385 0 2 $pass ||= ''
427 1 38 $options->{'iter'} || 10000

or 3 conditions

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