| 1 | package Crypt::Mac; | ||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||
| 3 | 16 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | 16 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 5 | 16 | our $VERSION = '0.091'; | |||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | 16 | ▶ | use Carp; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 8 | 16 | $Carp::Internal{(__PACKAGE__)}++; | |||||||||||||||||||||||||||||||
| 9 | 16 | ▶ | use CryptX; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | 3 | ▶ | sub addfile { | ||||||||||||||||||||||||||||||
|
Subroutine
addfile: called CC=9 SCAR=22.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 12 | 3 | my ($self, $file) = @_; | |||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||
| 14 | 3 | my ($handle, $close_handle); | |||||||||||||||||||||||||||||||
| 15 | 3 | ▶ | if (ref($file) && eval { defined fileno($file) }) { | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition100%3/3
ref $file and eval {
do {
defined fileno $file
}
}
MC/DC100%2/2
ref $file and eval {
do {
defined fileno $file
}
}
ref $file
eval {
do {
defined fileno $file
}
}
Truth table100%3/3
A and B
A= ref $fileB= eval {
do {
defined fileno $file
}
}
| |||||||||||||||||||||||||||||||||
| 16 | 1 | $handle = $file; | |||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||
| 18 | ▶ | elsif (defined($file) && !ref($file)) { | |||||||||||||||||||||||||||||||
|
Condition66%2/3
defined $file and not ref $file
MC/DC50%1/2
defined $file and not ref $file
defined $file
not ref $file
Truth table66%2/3
A and not(B)
A= defined $fileB= not ref $file
| |||||||||||||||||||||||||||||||||
| 19 | 1 | ▶ | open($handle, "<", $file) || croak "FATAL: cannot open '$file': $!"; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 20 | 1 | binmode($handle); | |||||||||||||||||||||||||||||||
| 21 | 1 | $close_handle = 1; | |||||||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||||||
| 23 | else { | ||||||||||||||||||||||||||||||||
| 24 | 1 | croak "FATAL: invalid handle"; | |||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||||||
| 27 | 2 | my $n; | |||||||||||||||||||||||||||||||
| 28 | 2 | my $buf = ""; | |||||||||||||||||||||||||||||||
| 29 | { | ||||||||||||||||||||||||||||||||
| 30 | 2 | local $SIG{__DIE__} = \&CryptX::_croak; | |||||||||||||||||||||||||||||||
| 31 | 2 | ▶ | while (($n = read($handle, $buf, 32*1024))) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 32 | 2 | $self->add($buf); | |||||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||||||
| 34 | 2 | ▶ | croak "FATAL: read failed: $!" unless defined $n; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||
| 36 | 2 | ▶ | close($handle) if $close_handle; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||||||
| 38 | 2 | return $self; | |||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||
| 41 | 0 | ▶ | sub CLONE_SKIP { 1 } # prevent cloning | ||||||||||||||||||||||||||||||
|
Subroutine
CLONE_SKIP: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||||||
| 43 | 16 | 1; | |||||||||||||||||||||||||||||||
| 44 | |||||||||||||||||||||||||||||||||
| 45 | =pod | ||||||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||||||
| 47 | =head1 NAME | ||||||||||||||||||||||||||||||||
| 48 | |||||||||||||||||||||||||||||||||
| 49 | Crypt::Mac - [internal only] | ||||||||||||||||||||||||||||||||
| 50 | |||||||||||||||||||||||||||||||||
| 51 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||
| 53 | Do not use this module directly. | ||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||
| 55 | Use a concrete MAC module instead. | ||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||
| 57 | =head1 SEE ALSO | ||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||
| 59 | =over | ||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||
| 61 | =item * L<CryptX> | ||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||
| 63 | =item * L<Crypt::Mac::HMAC>, L<Crypt::Mac::Poly1305>, L<Crypt::Mac::BLAKE2b>, L<Crypt::Mac::BLAKE2s> | ||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||
| 65 | =item * L<Crypt::Mac::OMAC>, L<Crypt::Mac::PMAC>, L<Crypt::Mac::XCBC>, L<Crypt::Mac::F9>, L<Crypt::Mac::Pelican> | ||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||
| 67 | =back | ||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||
| 69 | =cut | ||||||||||||||||||||||||||||||||