blib/lib/Net/SSH/Perl/Cipher/DES.pm

filter: Statementstmt 100% 33 / 33 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 60.0% 3 / 5 totaltotal 94.1% 48 / 51 SCAR 6.9
CC
2
Cov
97%
new
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« blib/lib/Net/SSH/Perl/Cipher/AES_CBC.pm ↑ Summary blib/lib/Net/SSH/Perl/Cipher/IDEA.pm »
1 package Net::SSH::Perl::Cipher::DES;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Net::SSH::Perl::Cipher;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use base qw( Net::SSH::Perl::Cipher );
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Net::SSH::Perl::Cipher::CBC;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Crypt::Cipher::DES;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 6 ▶sub keysize { 8 }
Subroutine keysize: called CC=1 SCAR=0.0
Pod undocumented
13  
14 sub new {
15 6 ▶ my $class = shift;
Subroutine new: called CC=2 SCAR=7.0
Pod documented
16 6 my $ciph = bless { }, $class;
17 6 ▶ $ciph->init(@_) if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 6 0 6
18 6 $ciph;
19 }
20  
21 sub init {
22 6 ▶ my $ciph = shift;
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
23 6 my($key, $iv) = @_;
24 6 $key = substr($key,0,$ciph->keysize);
25 6 my $des = Crypt::Cipher::DES->new($key);
26 6 $ciph->{cbc} = Net::SSH::Perl::Cipher::CBC->new($des, $iv);
27 }
28  
29 sub encrypt {
30 3 ▶ my($ciph, $text) = @_;
Subroutine encrypt: called CC=1 SCAR=0.0
Pod documented
31 3 $ciph->{cbc}->encrypt($text);
32 }
33  
34 sub decrypt {
35 3 ▶ my($ciph, $text) = @_;
Subroutine decrypt: called CC=1 SCAR=0.0
Pod documented
36 3 $ciph->{cbc}->decrypt($text);
37 }
38  
39 1 1;
40 __END__
« blib/lib/Net/SSH/Perl/Cipher/AES_CBC.pm ↑ Summary blib/lib/Net/SSH/Perl/Cipher/IDEA.pm »