line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::RIPEMD160; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
41976
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
54
|
|
4
|
1
|
|
|
1
|
|
9
|
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
473
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
require Exporter; |
7
|
|
|
|
|
|
|
require DynaLoader; |
8
|
|
|
|
|
|
|
require AutoLoader; |
9
|
|
|
|
|
|
|
@ISA = qw(Exporter AutoLoader DynaLoader); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Items to export into callers namespace by default |
12
|
|
|
|
|
|
|
@EXPORT = qw(); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
@EXPORT_OK = qw(); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$VERSION = '0.05'; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
bootstrap Crypt::RIPEMD160 $VERSION; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
#package RIPEMD160; # Package-Definition like in Crypt::IDEA |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
#use strict; |
23
|
1
|
|
|
1
|
|
8
|
use Carp; |
|
1
|
|
|
|
|
22
|
|
|
1
|
|
|
|
|
146
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub addfile |
26
|
|
|
|
|
|
|
{ |
27
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
890
|
|
28
|
3
|
|
|
3
|
0
|
1166562
|
my ($self, $handle) = @_; |
29
|
3
|
|
|
|
|
15
|
my ($package, $file, $line) = caller; |
30
|
3
|
|
|
|
|
6
|
my ($data); |
31
|
|
|
|
|
|
|
|
32
|
3
|
100
|
|
|
|
11
|
if (!ref($handle)) { |
33
|
2
|
50
|
|
|
|
19
|
$handle = $package . "::" . $handle unless ($handle =~ /(\:\:|\')/); |
34
|
|
|
|
|
|
|
} |
35
|
3
|
|
|
|
|
92
|
while (read($handle, $data, 8192)) { |
36
|
3
|
|
|
|
|
612
|
$self->add($data); |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub hexdigest |
41
|
|
|
|
|
|
|
{ |
42
|
16
|
|
|
16
|
0
|
13592
|
my ($self) = shift; |
43
|
16
|
|
|
|
|
27
|
my ($tmp); |
44
|
|
|
|
|
|
|
|
45
|
16
|
|
|
|
|
129
|
$tmp = unpack("H*", ($self->digest())); |
46
|
16
|
|
|
|
|
117
|
return(substr($tmp, 0,8) . " " . substr($tmp, 8,8) . " " . |
47
|
|
|
|
|
|
|
substr($tmp,16,8) . " " . substr($tmp,24,8) . " " . |
48
|
|
|
|
|
|
|
substr($tmp,32,8)); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub hash |
52
|
|
|
|
|
|
|
{ |
53
|
3
|
|
|
3
|
0
|
7
|
my($self, $data) = @_; |
54
|
|
|
|
|
|
|
|
55
|
3
|
50
|
|
|
|
15
|
if (ref($self)) { |
56
|
0
|
|
|
|
|
0
|
$self->reset(); |
57
|
|
|
|
|
|
|
} else { |
58
|
3
|
|
|
|
|
14
|
$self = new Crypt::RIPEMD160; |
59
|
|
|
|
|
|
|
} |
60
|
3
|
|
|
|
|
22
|
$self->add($data); |
61
|
3
|
|
|
|
|
28
|
$self->digest(); |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub hexhash |
65
|
|
|
|
|
|
|
{ |
66
|
10
|
|
|
10
|
0
|
7003
|
my($self, $data) = @_; |
67
|
|
|
|
|
|
|
|
68
|
10
|
100
|
|
|
|
22
|
if (ref($self)) { |
69
|
1
|
|
|
|
|
5
|
$self->reset(); |
70
|
|
|
|
|
|
|
} else { |
71
|
9
|
|
|
|
|
39
|
$self = new Crypt::RIPEMD160; |
72
|
|
|
|
|
|
|
} |
73
|
10
|
|
|
|
|
391
|
$self->add($data); |
74
|
10
|
|
|
|
|
21
|
$self->hexdigest(); |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
__END__ |